Hi Ben!
I am using the tapestry-jquery mixin for this:
tml:
<t:select t:id="yourId" model="yourModel" encoder="yourEncoder"
t:validate="required" value="yourValue"
t:mixins="jquery/bind" bind.context="${yourValue.pk}"
bind.event="yourSelectionChanged" bind.eventType="change"/>
page:
public Object onYourSelectionChanged(final long pk)
{
System.out.println(pk);
return null;
}
so any change of the select input control triggers "change" which calls
the "yourSelectionChanged" method, which is named
"onYourSelectionChanged" in java by tapestry convention. I believe you
can use "[${yourValue.pk}, ${whateverId}] to pass multiple arguments to
your method, too (be careful: this is just my gut feeling, never tried it)
Jens
Am 23.04.13 17:58, schrieb Ben Titmarsh:
After a lot of Googling around I'm unable to find a solution to my problem. I
want to handle the change event from a Select Component. I'm creating a bunch
of these components in a loop:
<t:select t:id="type" model="cardTypeModel" encoder="cardTypeEncoder"
value="cubeCard.cardType" blankOption="never"/>
And I've got the following handler declaration:
@OnEvent(component="type", value = "change")
public Object onChangeOfCardType(String value) {
System.out.println("onChange!!!");
return cardTypeZone.getBody();
}
Ideally I want to provide some context to this handler too so that it knows which CardType to update (i.e. which Select the event came from). The handler just isn't getting called at the moment, what am I doing wrong?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org