You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Johannes Becker <jo...@gmx.net> on 2005/06/20 13:57:46 UTC

How to iterate recursivley with JXTemplate

Hi,

I've got a function that returns a List. In this List again there is 
another Set.

Question:
- Can I iterate through a Set with <jx:forEach ?
- How would I do that? Another <jx:forEach ?

My JXTemplate:
...
<c:forEach select="#{getList}">
   <a>#{price}</b>
   <b>  <!-- here I want the Set iterated   -->    </b>
</c:forEach>

Cheers
Jonny

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


Re: How to iterate recursivley with JXTemplate

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jun 20, 2005, at 8:05 PM, Marc Salvetti wrote:

> Hello, maybe you can use jx:set for your pb. I have this kind of 
> sintax in my code and it's fine :
> <jx:set var="balance" value="#{$total-invoice - $total-deposit - 
> $total-deposit2}"/>

Many people feel that this sort of thing is an abuse of templating... 
why wouldn't you do this in the flowscript?

Cheers,
—ml—


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


Re: How to iterate recursivley with JXTemplate

Posted by Marc Salvetti <ma...@notremanou.net>.
Hello, maybe you can use jx:set for your pb. I have this kind of sintax 
in my code and it's fine :
<jx:set var="balance" value="#{$total-invoice - $total-deposit - 
$total-deposit2}"/>

Marc

Johannes Becker a écrit :

> Yep, now I have tried it and it worked!!
>
> And if somebody had an answer on the post "[JXTemplate] problems 
> accessing a value" I'd be the happiest man alive.
>
> Thanks
> Jonny
>
> Sebastien Arbogast wrote:
>
>> 2005/6/20, Johannes Becker <jo...@gmx.net>:
>>  
>>
>>> Hi,
>>>
>>> I've got a function that returns a List. In this List again there is
>>> another Set.
>>>
>>> Question:
>>> - Can I iterate through a Set with <jx:forEach ?
>>> - How would I do that? Another <jx:forEach ?
>>>
>>> My JXTemplate:
>>> ...
>>> <c:forEach select="#{getList}">
>>>   <a>#{price}</b>
>>>   <b>  <!-- here I want the Set iterated   -->    </b>
>>> </c:forEach>
>>>   
>>
>>
>> It seems to me that forEach is able to iterate on any Collection
>> subclass, including List's and Set's. Have you tried ?
>>
>>  
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>

	

	
		
___________________________________________________________________________ 
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
Téléchargez cette version sur http://fr.messenger.yahoo.com

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


Re: How to iterate recursivley with JXTemplate

Posted by Johannes Becker <jo...@gmx.net>.
Yep, now I have tried it and it worked!!

And if somebody had an answer on the post "[JXTemplate] problems 
accessing a value" I'd be the happiest man alive.

Thanks
Jonny

Sebastien Arbogast wrote:

>2005/6/20, Johannes Becker <jo...@gmx.net>:
>  
>
>>Hi,
>>
>>I've got a function that returns a List. In this List again there is
>>another Set.
>>
>>Question:
>>- Can I iterate through a Set with <jx:forEach ?
>>- How would I do that? Another <jx:forEach ?
>>
>>My JXTemplate:
>>...
>><c:forEach select="#{getList}">
>>   <a>#{price}</b>
>>   <b>  <!-- here I want the Set iterated   -->    </b>
>></c:forEach>
>>    
>>
>
>It seems to me that forEach is able to iterate on any Collection
>subclass, including List's and Set's. Have you tried ?
>
>  
>


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


Re: How to iterate recursivley with JXTemplate

Posted by Sebastien Arbogast <se...@gmail.com>.
2005/6/20, Johannes Becker <jo...@gmx.net>:
> Hi,
> 
> I've got a function that returns a List. In this List again there is
> another Set.
> 
> Question:
> - Can I iterate through a Set with <jx:forEach ?
> - How would I do that? Another <jx:forEach ?
> 
> My JXTemplate:
> ...
> <c:forEach select="#{getList}">
>    <a>#{price}</b>
>    <b>  <!-- here I want the Set iterated   -->    </b>
> </c:forEach>

It seems to me that forEach is able to iterate on any Collection
subclass, including List's and Set's. Have you tried ?

-- 
Sébastien Arbogast

WebCV : http://www.sebastien-arbogast.com
The Epseelon Project : http://www.epseelon.org

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