Andrew Madu napisaƂ(a):
Hi,
I have a date selection widget which I wish to automate. By automate what I mean is that I always want whatever the current year is to be the lowest selection option a user can make, then I want 10 additional years to be shown in the selection list. So for example if we take the current year, 2007, as the lowest selection option the highest selection option will be 2017.

At the moment I am hard coding the year drop down selection as so:

<fd:field id="year" required="true">
<fd:datatype base="string"/>
<fd:selection-list>
<fd:item value="2007">
<fd:label>2007</fd:label>
</fd:item>
<fd:item value="2008">
<fd:label>2008</fd:label>
</fd:item>
<fd:item value="2009">
<fd:label>2009</fd:label>
</fd:item>
...............
</fd:selection-list>
</fd:field>

Is there a way I can achieve this in cocoon without having to hard code the date values into my xml document?

You should generate the list of years in flowscript and use flow-jxpath selection list implementation[1].

Hope that helps.

[1] http://cocoon.apache.org/2.1/userdocs/widgetconcepts/selectionlists.html

--
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to