cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeroen Cranendonk" <j.cranend...@emaxx.nl>
Subject Re: XMLForm repeat tag power! ?
Date Fri, 13 Jun 2003 10:17:25 GMT
It does help a lot, thanks! :)
Someone should copy paste that to some documentation or sample ;)

Just one more question/thought, You only showed using <xf:output> fields, I
assume the textbox
and such fields work just as well ? (If you can find a getter method, you
can find the setter method too :)
There is one interesting thought I had, if the list of things is referred to
as a Set, which if I recall well
does not gueranty a fixed ordering, is there a possibility (mayby only
theoreticly) that when the page
gets loaded the set returns the elements in one order, and when the fields
get updated it returns them in
another order, with the result of updating the wrong elements ? :)

Just a thought ^.^

thanks a lot again :)
    Greetings,
        Jeroen C.

> On Friday, June 13, 2003, at 08:40 AM, Jeroen Cranendonk wrote:
> >
>
> <snip/>
>
> > Firstly, I've seen the samples in cvs that use the repeat tag, from
> > what I
> > see you reference a field
> > in the model/bean that returns a List, does this have to be a List, or
> > would
> > any Set or Collection do ?
> > what's the datatype that this thing expects ? :)
>
> I have used it successfully with a Set:
>
> public class Coverage {
>
> private Long id;
> private String name;
> private String description;
> private Coverage parent;
> private Set children; // of type Coverage //
> private Type type;
>
> // snip //
>
> }
>
> >
> > Secondly, and this is the important bit! Could this List also be a
> > list of
> > beans, and if it is, can we inside
> > the repeat tag reference fields of these beans ?
> > And if we can, how would this look , can someone post an example of
> > how the
> > repeat tag and it's contents would look in such a case ?
>
> here's the main Bean:
>
>      <xf:output ref="/name">
>        <xf:label>Name</xf:label>
>      </xf:output>
>
> here's the 'parent' Composite Bean :
>
>     <xf:output ref="/parent/name">
>        <xf:label>Parent</xf:label>
>      </xf:output>
>
> Here are the 'sibling' Composite Beans :
>
>      <xf:group ref="/parent/children">
>        <xf:label>Siblings</xf:label>
>        <xf:repeat nodeset="name">
>          <xf:output ref="."/>
>        </xf:repeat>
>      </xf:group>
>
> Here are the 'children'  Composite Beans :
>
>      <xf:group ref="/children">
>        <xf:label>Children</xf:label>
>        <xf:repeat nodeset="name">
>          <xf:output ref="."/>
>        </xf:repeat>
>      </xf:group>
>
> Here are the 'grand children'  Composite Beans :
>
>      <xf:group ref="/children">
>        <xf:label>Grand Children</xf:label>
>        <xf:repeat nodeset="children">
>           <xf:output ref="name"/>
>        </xf:repeat>
>      </xf:group>
>
> hope this helps
>
> regards Jeremy


Mime
View raw message