If you have the list, you can have the index in the list as id. Then, for 
description, you can pass a string to get info from the objects, like: 
"${name} - ${company.description}"
So you will pass to your property selection the collection and the format 
string. I've been using this way and it's very simple. No interfases and you 
can use two different descriptions for the same object. 
If you want this implementation of PropertySelectionModel tell me.

On 7/26/05, Robert Zeigler <[EMAIL PROTECTED]> wrote:
> 
> Incidentally, there is a generic "ListPropertySelectionModel"
> available on tassel
> 
> http://equalitylearning.org/Tassel/app?service=external/ViewComponent&sp=SListPropertySelectionModel
> 
> 
> It uses the interface approach; classes which implement the interface
> must implement the "public String getItemName" method.
> 
> Robert
> 
> Eric DIEP wrote:
> > OK - thanks, this was the way I was originally planning to do (create a
> > common interface).
> >
> > -- X. Y. ZHAO
> >
> > On 26-Jul-05, at 161611, Mark Dillon wrote:
> >
> >> There is an example in the mailing list archives of a reflection
> >> implementation of the IPropertySelectionModel. That's one option. I
> >> prefer to have all of my domain objects implement an interface that
> >> specifies a getDescription and a getID method, and have the
> >> IPropertySelectionModel just deal with the interface.
> >>
> >> Cheers,
> >> Mark
> >>
> >> On 7/26/05, X. Y. Zhao <[EMAIL PROTECTED]> wrote:
> >>
> >>> Hi:
> >>> I have several Lists of various domain objects which I would like to
> >>> use with the PropertySelection component. However, to use them, I
> >>> have to create an implementation of IPropertySelectionModel for each
> >>> domain object type (for the reason that I need to do xxx.getName() in
> >>> the IPropertySelectionModel's getLabel() for each impl.). Is there a
> >>> generic way to handle this situation without the need of creating all
> >>> these redundant classes?
> >>>
> >>> Thank you.
> >>>
> >>> -- X. Y. ZHAO
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: tapestry-user- 
> [EMAIL PROTECTED]
> >>>
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

Reply via email to