cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Re: How to set the items variable dynamically in JXTemplate
Date Wed, 14 Dec 2005 13:19:04 GMT
Okan Basegmez wrote:
> Hi, 
> 
> i use JXTemplate to build an XML file. From the
> Flowscript, i pass collection parameters to the
> template which are named like table1, table2, tablen.
> Then i want to iterate for each table parameter the
> contents like ( items="${table{$i}}" doesnt work )
unfortunately expression nesting is not available.

Couldn't you not pass table1 table2 but a single table-of-tables?
If you cannot do something it view you should try to restructure your data:

in controller:
var tables  = new java.util.LinkedList();
tables.add( table1 );
tables.add( table2 );

in view:
<jx:forEach var="table" items="${tables}">
     <jx:forEach var="row" items="${table}">
              ${row.name}
     </jx:forEach>
</jx:forEach>

> 
> <jx:forEach var="i" items="${tableindex}">
>    <jx:forEach var="row" items="${table${i}}">
>             ${row.name}
>    </jx:forEach>
> </jx:forEach>
> 
> Is it possible to set the name of the collection
> object for items parameter using concatenation of
> other strings?


-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message