cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ian.d.stew...@jpmchase.com
Subject Re: jx template and number format
Date Thu, 06 Apr 2006 21:37:33 GMT
I'm guessing that forEach is expecting int's for begin and end, and you're
actually passing in doubles (0.0 vs 0, 4.0 vs 4).  Is there a way within jx
to force the values to int's?


Ian

It's better to be hated for who you are
than loved for who you are not

Ian D. Stewart
Appl Dev Analyst-Advisory, DCS Automation
JPMorganChase Global Technology Infrastructure
Phone: (614) 244-2564
Pager: (888) 260-0078


                                                                                         
                                                  
                      "Philippe LAPLANCHE"                                               
                                                  
                      <philippe.laplanche@ho        To:       <users@cocoon.apache.org>
                                                    
                      rus-si.com>                   cc:                               
                                                     
                                                    Subject:  jx template and number format
                                                
                      04/06/2006 03:15 PM                                                
                                                  
                      Please respond to                                                  
                                                  
                      users                                                              
                                                  
                                                                                         
                                                  




I'm so tired of all the problems I have with jx templates ...
Am I the only one to use them or what ?
I'm beginning to regret that I left xsp for jx:templates

This time, I guess I have a number format problem. My forEach loop
doesn't work fine. The end attribute is not properly taken into account.

I'm using cocoon 2.1.8 on tomcat 5.5 and sun jdk 1.5

Here is how I intend to use forEach :

<jx:forEach var="line" varStatus="status" items="${local.ypResult.rows}"
begin="${startItem}" end="${endItem}">
             <item>
                         ...
             </item>
</jx:forEach>

When I manually put :
<jx:forEach var="line" varStatus="status" items="${local.ypResult.rows}"
begin="0" end="4">
everything works fine this way, but when I use ${startItem} and
${endItem}, I only get one <item>

Here's how I define startItem and endItem :
<jx:set var="startItem">${(local.skipResults %
local.bufferSize)}</jx:set>
<jx:set var="endItem">${(local.skipResults %
local.bufferSize)+PAGESIZE-1}</jx:set>

So I put this in my code :
${startItem}<br/>
${endItem}<br/>

And I get
0.0
4.0

So I guess I have a number formatting problem here. But after trying to
use parseInt() and Integer.intValue() with no success, well I'm stuck
again....

Can someone please help me ?

Thanks





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




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


Mime
View raw message