You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Apache Wiki <wi...@apache.org> on 2010/04/06 14:35:50 UTC

[Tapestry Wiki] Update of "Tapestry5HowtoSelectWithObjects" by ThiagoHdePaulaFigueiredo

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for change notification.

The "Tapestry5HowtoSelectWithObjects" page has been changed by ThiagoHdePaulaFigueiredo.
http://wiki.apache.org/tapestry/Tapestry5HowtoSelectWithObjects?action=diff&rev1=11&rev2=12

--------------------------------------------------

+ '''''Thiago H. de Paula Figueiredo: this approach is plain wrong. You have to retrieve a list of objects when you need just one of them (wrong) or put a list in a session (very wrong). In addition, the same class implementing two completely different interfaces is not a good idea. Just create one instance of OptionModelImpl for each of your options (objects) and pass them to a SelectModelImpl.'''''
+ 
  Creating a <SELECT> is a bit complicated and there is only support for strings and enums currently. (T5.0.13)
  
  see also: Tapestry5SelectObject

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: [Tapestry Wiki] Update of "Tapestry5HowtoSelectWithObjects" by ThiagoHdePaulaFigueiredo

Posted by Davor Hrg <hr...@gmail.com>.
Wow,

maybe you could make a better approach example page before trashing this one
?

Tapestry select component sucks big time for a simple relation from
hibernate
(for a small table with not too many values... otherwise I use
autocomplete).

If I provide OptionModelImpl for each entry, where from does the value come
from
after the form is submitted  ?
(I know, the answer... The question above just illustrates how your comment
on
the page only raises more questions without offering a solution. )

There are plenty of other ways to implement that, and it depends on the
situation which one is best.

I really see no problem if I have a table of 10 values that is an atribute
of some entity (DocumentType : internal,external,etc.). Selecting these
values from database for each request when needed to render the page,
and when only needed to set the value after submit is no big deal because
both hibernate and the database will cache it and handle the load without a
sweat.
The number of values selected from database each time will be much bigger
pain for the user to find in the select box (autocomplete is much better
then).

........ damn .... I'm just wasting time explaining ...

Please make a better example on the wiki, and I will find time to update
mine
with the points regarding when and if to use it.



Davor Hrg

On Tue, Apr 6, 2010 at 2:35 PM, Apache Wiki <wi...@apache.org> wrote:

> Dear Wiki user,
>
> You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for
> change notification.
>
> The "Tapestry5HowtoSelectWithObjects" page has been changed by
> ThiagoHdePaulaFigueiredo.
>
> http://wiki.apache.org/tapestry/Tapestry5HowtoSelectWithObjects?action=diff&rev1=11&rev2=12
>
> --------------------------------------------------
>
> + '''''Thiago H. de Paula Figueiredo: this approach is plain wrong. You
> have to retrieve a list of objects when you need just one of them (wrong) or
> put a list in a session (very wrong). In addition, the same class
> implementing two completely different interfaces is not a good idea. Just
> create one instance of OptionModelImpl for each of your options (objects)
> and pass them to a SelectModelImpl.'''''
> +
>  Creating a <SELECT> is a bit complicated and there is only support for
> strings and enums currently. (T5.0.13)
>
>  see also: Tapestry5SelectObject
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>