cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: [cforms] selection list binding
Date Thu, 11 Mar 2004 13:28:17 GMT
Ugo Cei <u.cei <at> cbim.it> writes:

> > Ok, let me clarify. I think I do nothing unusual. Yes, I have a form 
> > with a simple dynamic selection list. And I do the binding against a bean.
> 
> This is what I do all the time.

I thought so too :)

> > There are two known ways to set the selection list dynamically: 
> > setSelectionList(String uri) and setSelectionList(Object model, String 
> > valuePath, String labelPath). The first one is for the  <at> src, the latter

> > one for setting the selection list from flow (and using 
> > FlowJXPathSelectionList internally).
> > 
> > As I do not want to go back to sitemap I chose the latter one, remains 
> > only the question where to use it. 
> 
> var items = // some collection ...
> form.showForm("uri", { "items" : items });
> 
> <wd:field>
> ...
>    <wd:selection-list type="flow-jxpath" list-path="items"
>      value-path="value" label-path="label"/>
> ...
> </wd:field>

Ah, thanks, I did not know that it is possible this way. This would move it out
of the binding into the definition with usage of the business data object.

Only the flow script is "polluted" by "items" handling:
I have a displayList() function handling all list forms, some need a selection
list, other not, other two.

> > I hope this time it was written more straight forward and not that much 
> > irritating.
> 
> Don't worry, it's not you that are irritating, it's really me that's 
> being obtuse . And please excuse me if I still don't get what your 
> aiming for.

:-)

Do you have a solution for the 'non-value' entry in the items collection? I use
the selection list as filter for the list pages. And I want to provide an option
to do no filtering by this selection list.

Thanks,

Joerg


Mime
View raw message