cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: Simple Question on Repeaters
Date Wed, 26 Oct 2005 09:45:40 GMT
Philippe Gassmann wrote:
> Craig Gulliver wrote:
>> I want to use the initial-size attribute of the repeater definition. 
>> However I want to supply the value as form data and accessed as an 
>> expression. So my question, is it possible to use JXPath or JEXL 
>> expressions in the form definition? For example, <fd:repeater 
>> id=”objectListing” initial-size=”#{numberOfObjects}”>.
> Yes, you can use it if your form definition is procuced by a pipeline 
> like this
> <map:match pattern="myDynamicFormDefinition">
> <map:generate type="jx" name="path to the form definition.xml"/>
> </map:serialize type="xml"/>
> </map:match>
> After that you have to create your form using form = new 
> Form("cocoon:/myDynamicFormDefinition");
> But I do not know how to give parameters to the form definition that 
> are not "map:parameter"s

Oh man, a dynamic form definition to set the initial size is definitely 
overkill :-)

What about:
<fd:repeater id="objectListing">
var initialSize = ... whatever expression you want here ...
// Create new rows until we reach the wanted size
while(widget.size < initialSize) widget.addRow();


Sylvain Wallez                        Anyware Technologies
Apache Software Foundation Member     Research & Technology Director

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message