cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew <andrewm...@gmail.com>
Subject Re: checkbox widget with datatype vector
Date Sun, 23 Jul 2006 16:49:12 GMT
Hi,
is there a way I can build my list from accesing the required order class I
use in selection-list? In my jx I do:

<jx:forEach var="orderitem" items="${neworder.getOrderItems()}">

and then pull out the id I want in the checkbox as so:

<fi:styling value="${orderitem.getID()}" type="checkbox"/>

So would I be able to do:

selection-list src="neworder.getOrderItems().get()" ? And if so how would
the selection-list know how to iterate through the object to pull out all
orderitem id's?

regards

Andrew

On 23/07/06, Andrew <andrewmadu@gmail.com> wrote:
>
> Hi Jason,
>
>
> > I'm guessing that this is displayed multiple times using a JX forEach
> > loop, rather than a repeater?
>
>
>
> that is correct. What benefit would there be to using a repeater over the
> method I am using?
>
> I think just using an fd:multivaluefield should work;
>
>
> No. Unfortunately this does not work, as it seems that at least one
> instance of the widget is required, where as in my case you will always
> start with zero items in a shopping cart, so there would be nothing to
> selectin the first instance. I also noticed that my checkbox was overwritten
> with a selection list box which is not what I want at all. I used the
> following:
>
> widget:
>
>
>      <ft:widget id= "delItem">
>        <fi:styling value="${orderitem.getID()}" type="checkbox"/>
>     </ft:widget>
>
> validation form:
>
>     <fd:multivaluefield id="delItem">
>       <fd:datatype base="string"/>
>     </fd:multivaluefield>
>
> the widget will
> > take care of parsing the multiple values from the request into an Array
> > object.  That would also simplify your flowscript since you'll always
> > get an Array rather than having to do the if/else for single vs.
> > multiple selection.
> >
> > However, usually multivaluefield widgets have their individual checkbox
> > items generated from a selection-list, rather than by iterating manually
> > and calling ft:widget multiple times with different values.  I'm not
> > sure how your approach will work with AJAX updates since it's a
> > nonstandard use of the widget.
>
>
> A repeater in itself, also, is of no use to me as this, as you know, only
> allows me to repeat a number of other widgets an unspecified amount of
> times.
>
> regards
>
> Andrew
>
>
>
>

Mime
View raw message