You put a string into a mathematical expression. Look at the NumberFormatExpression :)
setTableSize(tableSizeModel.getOption(0).toString()); <----String On 10/9/07, Ken nashua <[EMAIL PROTECTED]> wrote: > > > Folks, I still cannot get any coercian on this propertyselection > > Can anyone elaborater on whats going on? Aren't we suppose to use this > as-is in OGNL? > > <span jwcid="@If" condition="ognl:(index % tableSize) == 0"> > > My condition keeps causing this exception... > > > For input string: "tableSize" > > > > java.lang.NumberFormatException > > > > For input string: "tableSize" > > > > > > > > > Stack Trace: > > > > > > > java.lang.NumberFormatException.forInputString(NumberFormatException.java > :48) > java.lang.Long.parseLong(Long.java > :403) > java.lang.Long.parseLong(Long.java > :461) > ognl.OgnlOps.longValue(OgnlOps.java > :220) > ognl.OgnlOps.remainder(OgnlOps.java > :932) > ognl.ASTRemainder.getValueBody( > ASTRemainder.java:51) > > ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:202) > ognl.SimpleNode.getValue( > SimpleNode.java:246) > ognl.ASTEq.getValueBody(ASTEq.java > :50) > > ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:202) > ognl.SimpleNode.getValue( > SimpleNode.java:246) > ognl.Ognl.getValue(Ognl.java:494) > > Best regards > Ken in nashua > > From: [EMAIL PROTECTED] > To: users@tapestry.apache.org > Subject: RE: does T-4.1.* have a COUNT component? > Date: Tue, 9 Oct 2007 14:08:57 -0400 > > > > > > > > > Just one final help ques... > > I switched to PropertySelection > > my condition now always yeilds a divide by zero exception. > > Since my propertlselection is strings... how do i model my condition now? > condition="ognl:(index % tableSize) ??? > > > <span jwcid="[EMAIL PROTECTED]"> > <table width="100%" border=1> > <tr> > <td width="25%" align="left" NOWRAP> > <span jwcid="@Insert" value="Table Size"/> > <select jwcid="@PropertySelection" model=" > ognl:@[EMAIL PROTECTED]" > value="ognl:tableSize" onchange="javascript:this.form.events.refresh > ();"></select> > > </td> > </tr> > </table> > </span> > > <span jwcid="[EMAIL PROTECTED]"> > <table width="100%"> > <tr> > <span jwcid="[EMAIL PROTECTED]" source="ognl:collection" > value="ognl:currentObject" index="ognl:index"> > <span jwcid="@If" condition="ognl:(index % tableSize) == > 0"> > <span jwcid="@Insert" value="</tr><tr>" raw="true"/> > </span> > <td> </td> > </span> > </tr> > </table> > </span> > > > > Best regards > Ken in nashua > > From: [EMAIL PROTECTED] > To: users@tapestry.apache.org > Subject: RE: does T-4.1.* have a COUNT component? > Date: Tue, 9 Oct 2007 11:08:14 -0400 > > > > > > > > > Thanks Rob... I got it to work... here is the template logic. > > <tr> > <span jwcid="[EMAIL PROTECTED]" source="ognl:collection" > value="ognl:currentObject" index="ognl:index"> > <span jwcid="@If" condition="ognl:(index % 3) == 0"> > <span jwcid="@Insert" value="</tr><tr>" raw="true"/> > <td> </td> > </span> > <span jwcid="@Else"> > <td> </td> > </span> > </span> > </tr> > > Best regards > Ken in nashua > > From: [EMAIL PROTECTED] > To: users@tapestry.apache.org > Subject: RE: does T-4.1.* have a COUNT component? > Date: Tue, 9 Oct 2007 10:59:17 -0400 > > > > > > > > > I will try that Rob... so your saying I do not need the ELSE component? > > Best regards > Ken in nashua > > From: [EMAIL PROTECTED] > To: users@tapestry.apache.org > Subject: RE: does T-4.1.* have a COUNT component? > Date: Tue, 9 Oct 2007 10:36:01 -0400 > > > > > > > > > Ok, I am trying this now... hopefully it will work... > > <tr> > <span jwcid="[EMAIL PROTECTED]" source="ognl:collection" > value="ognl:currentObject" index="ognl:index"> > <span jwcid="@If" condition="ognl:(index % 3) == 0"> > </tr><tr> > <td></td> > </span> > <span jwcid="@Else"> > <td></td> > </span> > </span> > </tr> > > Best regards > Ken in nashua > > From: [EMAIL PROTECTED] > To: users@tapestry.apache.org > Subject: RE: does T-4.1.* have a COUNT component? > Date: Tue, 9 Oct 2007 10:33:33 -0400 > > > > > > > > > Ok, now I have the template PARSE problem... on the </tr><tr> line... this > is what ROB was referring to in earlier post. > > Why hasn't tapestry fixed this? Is there a way around it? > > <tr> > <span jwcid="[EMAIL PROTECTED]" source="ognl:collection" > value="ognl:currentObject" index="ognl:index"> > <span jwcid="@If" condition="ognl:(index % 3) == 0"> > </tr><tr> > </span> > <td>render image stuff</td> > </span> > </tr> > > Best regards > Ken in nashua > > From: [EMAIL PROTECTED] > To: users@tapestry.apache.org > Subject: RE: does T-4.1.* have a COUNT component? > Date: Tue, 9 Oct 2007 10:26:55 -0400 > > > > > > > > > I am giving this a shot... > > <tr> > <span jwcid="[EMAIL PROTECTED]" source="ognl:collection" > value="ognl:currentObject" index="ognl:index"> > <span jwcid="@If" condition="ognl:(index % 3) == 0"> > </tr><tr> > </span> > <td> > </td> > </span> > > Best regards > Ken in nashua > > From: [EMAIL PROTECTED] > To: users@tapestry.apache.org > Subject: RE: does T-4.1.* have a COUNT component? > Date: Tue, 9 Oct 2007 10:20:40 -0400 > > > > > > > > > OK given 9 elements... > > 0 1 2 3 4 5 6 7 8 9 > > Here is the case logic... > 1. I need to render a <TR> on the 1st of every 3rd. > 2. I need to render a </TR> on 3rd of every 3rd > > I am not sure if "ognl:(index % 3) == 0" even qualifies for any of these > but I need two cases. > > Best regards > Ken in nashua > > From: [EMAIL PROTECTED] > To: users@tapestry.apache.org > Subject: RE: does T-4.1.* have a COUNT component? > Date: Tue, 9 Oct 2007 10:16:23 -0400 > > > > > > > > > Richard... that worked... (or at least the condition is functioning). > Thanks. > > BUT... > > Only half the rows contain 2 elements. So the logic is working only half > way. To get this proper, there needs to be a startOfRow condition and an > endOfRow condition. > > Can anyone elaborate on a formula for that? Thanks in advance. > > Best regards > Ken in nashua > > From: [EMAIL PROTECTED] > To: users@tapestry.apache.org > Subject: RE: does T-4.1.* have a COUNT component? > Date: Tue, 9 Oct 2007 10:02:09 -0400 > > > > > > > > > I guess I am trying to determine what the two conditions are for > rendering. There is a startOfRow <TR> condition and then an endOfRow </TR> > condition. > > Thanks for any tips. > > Best regards > Ken in nashua > > From: [EMAIL PROTECTED] > To: users@tapestry.apache.org > Subject: RE: does T-4.1.* have a COUNT component? > Date: Tue, 9 Oct 2007 09:55:07 -0400 > > > > > > > > > Can anyone explain why this code renders only the true case? > > It is as if the ELSE does not even work. > > <span jwcid="[EMAIL PROTECTED]" source="ognl:collection" > value="ognl:currentObject" index="ognl:index"> > <span jwcid="@If" condition="(ognl:index % 3)) == 0"> > <tr> > <td>true case</td> > </tr> > </span> > <span jwcid="@Else"> > <td>false case</td> > </span> > </span> > > If I have a list of elements 9 in length... > > I should get 3 rows in my table right? > > Can anyone check this out? Either there is a bug in ELSE component or the > condition is bogus to render 3 rows. > > Thanks in advance. > > Best regards > Ken in nashua > > From: [EMAIL PROTECTED] > To: users@tapestry.apache.org > Subject: does T-4.1.* have a COUNT component? > Date: Mon, 8 Oct 2007 14:27:29 -0400 > > > > > > > > > Ok I tried a custom Loop hybrid but that failed to do uncoordinated > indices between collection and loop. > > All I want to do is increment a count within the template and act on it > when it reaches a certain value and then reset it. > > IE. render <TR> tag every 3 iterations of my outer For loop. > > Does this exist in Tapestry? > > Best regards > Ken in nashua > Climb to the top of the charts! Play Star Shuffle: the word scramble > challenge with star power. Play Now! > > Peek-a-boo FREE Tricks & Treats for You! Get 'em! > > Windows Live Hotmail and Microsoft Office Outlook – together at last. Get > it now! > > Climb to the top of the charts! Play Star Shuffle: the word scramble > challenge with star power. Play Now! > > Climb to the top of the charts! Play Star Shuffle: the word scramble > challenge with star power. Play Now! > > Climb to the top of the charts! Play Star Shuffle: the word scramble > challenge with star power. Play Now! > > Help yourself to FREE treats served up daily at the Messenger Café. Stop > by today! > > Windows Live Hotmail and Microsoft Office Outlook – together at last. Get > it now! > > Peek-a-boo FREE Tricks & Treats for You! Get 'em! > > Peek-a-boo FREE Tricks & Treats for You! Get 'em! > > Climb to the top of the charts! Play Star Shuffle: the word scramble > challenge with star power. Play Now! > > _________________________________________________________________ > Help yourself to FREE treats served up daily at the Messenger Café. Stop > by today. > > http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline