You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Harald Geritzer <h....@gmail.com> on 2008/12/01 21:58:43 UTC

[t5] onEvent mixin failure since 5.0.17 - wrong response sent back to server

hi all,

i am using the onEvent mixing but since 5.0.17 my code does not seem to work any more.

though the event response should be "cost1|cost2" tapestry seems to ignore my textstreamresponse and
firebug reports that the response is the value of the selectbox itself
(post: value	750, response: {"value":"750"} instead of cost1|cost2).

any ideas? thank you


i got a select box on my page:
==============================

<t:select t:id="selectQuantity" value="orderItem.quantity" model="graduatedQuantities" 
t:mixins="t5components/OnEvent" event="change" onCompleteCallback="onQuantityChange"/>

with the according javascript function:
=======================================

	<script type="text/javascript">
         function onQuantityChange(response)
         {
	    tokens = response.split("|")
             $('costWithoutVat').value = tokens[0];
             $('costWithVat').value = tokens[1];
         }
	</script>


in my code there is an event handler:
=====================================

	@OnEvent(component = "selectQuantity", value = "change")
	public Object onChangeFromSelectQuantity(int value) {
		return quantityChange(value);
	}
	
	public StreamResponse quantityChange(int value)
	{
		getOrderItem().setQuantity(value);
		StringBuilder sb = new StringBuilder();
		sb.append(getCostWithoutVat());
		sb.append("|");
		sb.append(getCostWithVat());
	   	return new TextStreamResponse("text/html", sb.toString());
	}


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [t5] onEvent mixin failure since 5.0.17 - wrong response sent back to server

Posted by Harald Geritzer <h....@gmail.com>.
Sven Homburg schrieb:
> changes submitted into trunk

thank you

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [t5] onEvent mixin failure since 5.0.17 - wrong response sent back to server

Posted by Hugo Palma <hu...@gmail.com>.
Cool, thanks again.

On Tue, Dec 9, 2008 at 3:22 PM, Sven Homburg <ho...@googlemail.com>wrote:

> also done
>
> 2008/12/9 Hugo Palma <hu...@gmail.com>
>
> > Thanks.
> > One more thing, i noticed that the fix now forces the event listener
> method
> > to return a StreamResponse. If not a ClassCastException is thrown.
> > Shouldn't the component treat the same cases of return types from event
> > listener methods as Tapestry does ? In my current usecase for example i
> > want
> > to return an embedded component but i can't do that using the OnEvent
> > component.
> >
> > On Tue, Dec 9, 2008 at 2:47 PM, Sven Homburg <homburgs@googlemail.com
> > >wrote:
> >
> > > done! named 5.0.18-SNAPSHOT but compiled against Tapestry 5.0.17
> > >
> > > 2008/12/9 Hugo Palma <hu...@gmail.com>
> > >
> > > > Can you guys upload a SNAPSHOT release or something with this fix ?
> > > >
> > > > On Mon, Dec 1, 2008 at 9:31 PM, Sven Homburg <
> homburgs@googlemail.com
> > > > >wrote:
> > > >
> > > > > changes submitted into trunk
> > > > >
> > > > > 2008/12/1 Harald Geritzer <h....@gmail.com>
> > > > >
> > > > > >
> > > > > > seems t5components/onEvent changed its behaviour and always sends
> > > back
> > > > > the
> > > > > > field's value as repsonse. is there a way to get the old
> behaviour
> > > > back?
> > > > > >
> > > > > >
> > > > > >
> > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > with regards
> > > > > Sven Homburg
> > > > > http://www.chenillekit.org
> > > > > http://tapestry5-components.googlecode.com
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > with regards
> > > Sven Homburg
> > > http://www.chenillekit.org
> > > http://tapestry5-components.googlecode.com
> > >
> >
>
>
>
> --
> with regards
> Sven Homburg
> http://www.chenillekit.org
> http://tapestry5-components.googlecode.com
>

Re: [t5] onEvent mixin failure since 5.0.17 - wrong response sent back to server

Posted by Sven Homburg <ho...@googlemail.com>.
also done

2008/12/9 Hugo Palma <hu...@gmail.com>

> Thanks.
> One more thing, i noticed that the fix now forces the event listener method
> to return a StreamResponse. If not a ClassCastException is thrown.
> Shouldn't the component treat the same cases of return types from event
> listener methods as Tapestry does ? In my current usecase for example i
> want
> to return an embedded component but i can't do that using the OnEvent
> component.
>
> On Tue, Dec 9, 2008 at 2:47 PM, Sven Homburg <homburgs@googlemail.com
> >wrote:
>
> > done! named 5.0.18-SNAPSHOT but compiled against Tapestry 5.0.17
> >
> > 2008/12/9 Hugo Palma <hu...@gmail.com>
> >
> > > Can you guys upload a SNAPSHOT release or something with this fix ?
> > >
> > > On Mon, Dec 1, 2008 at 9:31 PM, Sven Homburg <homburgs@googlemail.com
> > > >wrote:
> > >
> > > > changes submitted into trunk
> > > >
> > > > 2008/12/1 Harald Geritzer <h....@gmail.com>
> > > >
> > > > >
> > > > > seems t5components/onEvent changed its behaviour and always sends
> > back
> > > > the
> > > > > field's value as repsonse. is there a way to get the old behaviour
> > > back?
> > > > >
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > with regards
> > > > Sven Homburg
> > > > http://www.chenillekit.org
> > > > http://tapestry5-components.googlecode.com
> > > >
> > >
> >
> >
> >
> > --
> > with regards
> > Sven Homburg
> > http://www.chenillekit.org
> > http://tapestry5-components.googlecode.com
> >
>



-- 
with regards
Sven Homburg
http://www.chenillekit.org
http://tapestry5-components.googlecode.com

Re: [t5] onEvent mixin failure since 5.0.17 - wrong response sent back to server

Posted by Hugo Palma <hu...@gmail.com>.
Thanks.
One more thing, i noticed that the fix now forces the event listener method
to return a StreamResponse. If not a ClassCastException is thrown.
Shouldn't the component treat the same cases of return types from event
listener methods as Tapestry does ? In my current usecase for example i want
to return an embedded component but i can't do that using the OnEvent
component.

On Tue, Dec 9, 2008 at 2:47 PM, Sven Homburg <ho...@googlemail.com>wrote:

> done! named 5.0.18-SNAPSHOT but compiled against Tapestry 5.0.17
>
> 2008/12/9 Hugo Palma <hu...@gmail.com>
>
> > Can you guys upload a SNAPSHOT release or something with this fix ?
> >
> > On Mon, Dec 1, 2008 at 9:31 PM, Sven Homburg <homburgs@googlemail.com
> > >wrote:
> >
> > > changes submitted into trunk
> > >
> > > 2008/12/1 Harald Geritzer <h....@gmail.com>
> > >
> > > >
> > > > seems t5components/onEvent changed its behaviour and always sends
> back
> > > the
> > > > field's value as repsonse. is there a way to get the old behaviour
> > back?
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > with regards
> > > Sven Homburg
> > > http://www.chenillekit.org
> > > http://tapestry5-components.googlecode.com
> > >
> >
>
>
>
> --
> with regards
> Sven Homburg
> http://www.chenillekit.org
> http://tapestry5-components.googlecode.com
>

Re: [t5] onEvent mixin failure since 5.0.17 - wrong response sent back to server

Posted by Sven Homburg <ho...@googlemail.com>.
done! named 5.0.18-SNAPSHOT but compiled against Tapestry 5.0.17

2008/12/9 Hugo Palma <hu...@gmail.com>

> Can you guys upload a SNAPSHOT release or something with this fix ?
>
> On Mon, Dec 1, 2008 at 9:31 PM, Sven Homburg <homburgs@googlemail.com
> >wrote:
>
> > changes submitted into trunk
> >
> > 2008/12/1 Harald Geritzer <h....@gmail.com>
> >
> > >
> > > seems t5components/onEvent changed its behaviour and always sends back
> > the
> > > field's value as repsonse. is there a way to get the old behaviour
> back?
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
> >
> > --
> > with regards
> > Sven Homburg
> > http://www.chenillekit.org
> > http://tapestry5-components.googlecode.com
> >
>



-- 
with regards
Sven Homburg
http://www.chenillekit.org
http://tapestry5-components.googlecode.com

Re: [t5] onEvent mixin failure since 5.0.17 - wrong response sent back to server

Posted by Hugo Palma <hu...@gmail.com>.
Can you guys upload a SNAPSHOT release or something with this fix ?

On Mon, Dec 1, 2008 at 9:31 PM, Sven Homburg <ho...@googlemail.com>wrote:

> changes submitted into trunk
>
> 2008/12/1 Harald Geritzer <h....@gmail.com>
>
> >
> > seems t5components/onEvent changed its behaviour and always sends back
> the
> > field's value as repsonse. is there a way to get the old behaviour back?
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> with regards
> Sven Homburg
> http://www.chenillekit.org
> http://tapestry5-components.googlecode.com
>

Re: [t5] onEvent mixin failure since 5.0.17 - wrong response sent back to server

Posted by Sven Homburg <ho...@googlemail.com>.
changes submitted into trunk

2008/12/1 Harald Geritzer <h....@gmail.com>

>
> seems t5components/onEvent changed its behaviour and always sends back the
> field's value as repsonse. is there a way to get the old behaviour back?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
with regards
Sven Homburg
http://www.chenillekit.org
http://tapestry5-components.googlecode.com

Re: [t5] onEvent mixin failure since 5.0.17 - wrong response sent back to server

Posted by Harald Geritzer <h....@gmail.com>.
seems t5components/onEvent changed its behaviour and always sends back the field's value as 
repsonse. is there a way to get the old behaviour back?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org