know how to do that. Anyway, writing your own ValueEncoder is easy. > * What objects will be used as options? There's no way for Tapestry to do > that automatically in a reasonable way even when using tapestry-hibernate. > And SelectModelFactory already does the heavy lifting for you. >
To be honest I never understood value encoder.... and don't use it. When rendering a page all you need are a) the list of options and b) which one is selected. Then you have a handler: onChangeFromYourSelect(int value) and the value gets passed in. Then it's up to you to map that value/id back to an object :) On Mon, 2011-02-21 at 13:41 -0300, Thiago H. de Paula Figueiredo wrote: > On Mon, 21 Feb 2011 13:36:55 -0300, Richard Hill <r...@su3analytics.com> > wrote: > > > I always thought it would be nice if tap could generate a drop down > > given just a list - it could take the object id and toString() as values > > for example. > > There are two problems that you need to solve when writing a <select>: > > * How do you map objects to option values? If you're using > tapestry-hibernate, this is already done. If not, Tapestry just cannot > know how to do that. Anyway, writing your own ValueEncoder is easy. > * What objects will be used as options? There's no way for Tapestry to do > that automatically in a reasonable way even when using tapestry-hibernate. > And SelectModelFactory already does the heavy lifting for you. > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org