On Thu, 24 Feb 2011 11:58:26 -0300, Richard Hill <r...@su3analytics.com> wrote:

Hi - again :)

Hi!

I am supplying select and option models, which seem to work fine. But
how how do I supply a context? The t:select component does not appear to
take one. Without this I cannot know to what object my state change
relates.

Have you read the Select component documentation? (http://tapestry.apache.org/current/tapestry-core/ref/org/apache/tapestry5/corelib/components/Select.html). "The event handler method for the event valuechanged is used to provide the available car models of the currently selected car maker. The new Select's value is passed as context."

public Object onValueChanged(CarMaker maker)

In other words: you will receive the selected option as the event handler method parameter.

I've looked at valueencoders, but according to the docs, and from what
Thiago said yesterday, this seems to be alternative approach to using
models, which doesn't help.

I haven't said that. ValueEncoder and SelectModel are not alternative approaches to do the same thing. They do different things: SelectModel provides the options (including labels) and ValueEncoder encodes them for the value attribute of the option tag.

Here's the description from the SelectModel javadoc:

"(SelectModel) Defines the possible options and option groups for a <select> [X]HTML element.

Primarily used by the Select component, but potentially used by anything similar, that needs to present a list of options to the user. Generally paired with a ValueEncoder to create client-side representations of server-side values."

Please read the documentation before asking. ;)

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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

Reply via email to