On Mon, 21 Feb 2011 13:52:46 -0300, Richard Hill <r...@su3analytics.com>
wrote:
To be honest I never understood value encoder.... and don't use it.
Recommendation: learn it and use it. In software development, ignorance is
not bliss. :)
When
rendering a page all you need are a) the list of options and b) which
one is selected.
This is not correct at all. You still need an object <-> value mapping,
even if it is provided automatically some way (Tapestry itself for String
and primitive types, tapestry-hibernate for Hibernate entities. In other
words, what will be the value of the value attribute in the <option>
element corresponding to your object that represents an option?
Then you have a handler: onChangeFromYourSelect(int
value) and the value gets passed in.
What is the type of the options you're presenting to your users? In the
above case, if it's not integer values, the parameter could be of the type
you're editing.
Then it's up to you to map that value/id back to an object :)
Are you using tapestry-hibernate? If yes, you're using ValueEncoders
provided by it.
--
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