You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Patrick Casey <pa...@adelphia.net> on 2005/04/19 06:38:10 UTC
Yet Another Stupid Syntax Question
Hi yet again,
I've got a requirement that my forms be 508 compliant. One aspect of
that means I need to put scope tags inside my column and row headers e.g.
<table>
<tr>
<th> </th>
<th scope="col" >Spring</th> <th scope="col" >Summer</th> <th scope="col"
>Autumn</th> <th scope="col" >Winter</th> </tr>
<tr> <td scope="row" >Betty</td> <td>9-5</td> <td>10-6</td>
<td>8-4</td><td>7-3</td>
</tr>
<tr> <td scope="row" >Wilma</td> <td>10-6</td> <td>10-6</td> <td>9-5</td>
<td>9-5</td>
</tr>
<tr> <td scope="row" >Fred</td> <td>10-6</td> <td>10-6</td> <td>10-6</td>
<td>10-6</td>
</tr>
</table>
I'm having a wee bit of a problem figuring out how to tell tapestry to
render the *first* td with a scope tag and all subsequent td without one.
Right now I'm rendering my <td> elements with this foreach:
<td jwcid="@Foreach" element="td"
source = "ognl:theList"
value="ognl:theItem"
scope="row">
<span jwcid="@Insert" value="ognl:theRow[theItem.fieldName]" />
</td>
Unfortunately that puts the scope tag on every <td> which isn't what I want
or need. I think I need a way to insert some sort of conditional based on
the Foreach's index property, but my multiple attempts at doing so have
consistely either A) done nothing, or B) generated a nice stack trace.
Can anyone suggest a syntax to do what I'm looking for?
--- Pat
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Yet Another Stupid Syntax Question
Posted by Kent Tong <ke...@cpttm.org.mo>.
Patrick Casey <patcasey <at> adelphia.net> writes:
> <td jwcid=" <at> Foreach" element="td"
> source = "ognl:theList"
> value="ognl:theItem"
> scope="row">
> <span jwcid=" <at> Insert" value="ognl:theRow[theItem.fieldName]" />
> </td>
Try this:
<td jwcid="myForEach@Foreach" element="td"
source = "ognl:theList"
value="ognl:theItem"
scope="ognl:components.myForEach.index == 0 ? 'row' : null">
<span jwcid="@Insert" value="ognl:theRow[theItem.fieldName]" />
</td>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Yet Another Stupid Syntax Question
Posted by Ivano Pagano <i....@mclink.it>.
Maybe this could work for you?
<td jwcid="@Any" scope="ognl:components.myForEach.index == 0? 'row' : null">
</td>
from the wiki FAQ:
http://wiki.apache.org/jakarta-tapestry/FrequentlyAskedQuestions/OptionalParameters
Ivano
Patrick Casey wrote:
> Please disregard, I figured this out on my own. In case anyone's
>curious, this seems to work fine (although there may be a better solution).
>
><span jwcid="myForEach" >
><span jwcid="@Conditional" condition="ognl:components.myForEach.index == 0">
> <td scope="row">
> <span jwcid="@Insert" value="ognl:theRow[theItem.fieldName]" />
>
> </td>
></span>
><span jwcid="@Conditional" condition="ognl:components.myForEach.index != 0">
> <td>
> <span jwcid="@Insert" value="ognl:theRow[theItem.fieldName]"
>/>
> </td>
> </span>
> </span>
>
>--- Pat
>
><snip>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>__________ Informazione NOD32 1.1069 (20050419) __________
>
>Questo messaggio � stato controllato dal Sistema Antivirus NOD32
>http://www.nod32.it
>
>
>
>
>
--
Questa e-mail e gli eventuali file allegati sono da ritenersi confidenziali e rivolti alle sole persone in indirizzo; vi richiediamo pertanto di non diffonderlo ad altri se cio non � espressamente indicato.
Se il messaggio vi � stato recapitato per errore vi preghiamo di distruggerlo e di volerci cortesemente avvisare.
Grazie per la collaborazione.
RE: Yet Another Stupid Syntax Question
Posted by Patrick Casey <pa...@adelphia.net>.
Please disregard, I figured this out on my own. In case anyone's
curious, this seems to work fine (although there may be a better solution).
<span jwcid="myForEach" >
<span jwcid="@Conditional" condition="ognl:components.myForEach.index == 0">
<td scope="row">
<span jwcid="@Insert" value="ognl:theRow[theItem.fieldName]" />
</td>
</span>
<span jwcid="@Conditional" condition="ognl:components.myForEach.index != 0">
<td>
<span jwcid="@Insert" value="ognl:theRow[theItem.fieldName]"
/>
</td>
</span>
</span>
--- Pat
<snip>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org