tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harald Geritzer <h.gerit...@gmail.com>
Subject [t5] onEvent mixin failure since 5.0.17 - wrong response sent back to server
Date Mon, 01 Dec 2008 20:58:43 GMT

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


Mime
View raw message