On Sunday 15 January 2006 14:15, Martin Strand wrote: > How about using <component> attributes instead of the <binding> element? > i.e. we would have > > <component id="loop" type="For" source="ognl:someCollection"/> > > instead of > > <component id="loop" type="For"> > <binding name="source" value="ognl:someCollection"/> > </component> >
I have to say I always use what I regard as a much simpler alternative. 1) I never have .page files, and only .jwc files when there is not need of a java class to do anything in the component (otherwise I just annotate the java class) 2) I always include as much as I can in the tempate file - I find refering out to another specification file a real pain in trying to understand what is going on. Therefore what you are doing above, I would always do as In the template <span jwcid="@For" source="ognl:someCollection" value="ognl:someObject" > ... <span jwcid="@Insert" value="ognl:someObject.someField">Text </span> (or any other sort of text) </span> And in the java file public abstract void setSomeCollection( List<MyObject> l); and public void pageBeginRender (PageEvent event) { if (!event.getRequestCycle().isRewinding()) { setSomeCollection( --- got from wherever); ... } } -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]