Instead of having a loop within a loop, just have a loop and output <tr> and 
<td> manually.

In .tml,
  <table  border="0">
      
           <t:loop  source="dataList" value="colValue" index="myIndex">

            <t:if test="startRow">
                   <t:outputraw value="startTR"/>
           </t:if>
           <td >                
                        ${value}
           </td>
         
           <t:if test="endRow">
                   <t:outputraw value="endTR"/>
           </t:if>
        </t:loop>
        
</table>

In page java : 


     public boolean isStartRow(){
                return (myIndex%4 ==0);
        }
        
        public boolean isEndRow(){
                return (myIndex%4 ==3);
        }
        
        public String getStartTR(){
                return "<tr>";
        }
        
        public String getEndTR(){
                return "</tr>";
        }
        

Shing








Home page : http://www.lombok.demon.co.uk/



--- On Sun, 21/12/08, Tan cyb...@n <quesoft.cyber...@gmail.com> wrote:

> From: Tan cyb...@n <quesoft.cyber...@gmail.com>
> Subject: Loop object question.
> To: "Tapestry users" <users@tapestry.apache.org>
> Cc: "Tan cyb...@n" <quesoft.cyber...@gmail.com>
> Date: Sunday, 21 December, 2008, 12:21 PM
> hi all,
> 
> i'm newbie on java and tapestry ,i have problem on my
> loop 's data example
> 
> <t:loop source="prop:Datalist"
> value="prop:colvalue">
>        <tr>
>             <t:loop source="*(i wan to get the
> array of colvalue here )*"
> value="prop:value">
>                       <td>
>                      ${value}
>                         </td>
>              </t:loop
>         </tr>
> </t:loop>
> 
> my Datalist is an ArrayList<String[]>  , my colvalue
> is String.
> my data inside the datalist example like below:  ( total 4
> lines of records)
> ["valueLine1-col1" ,"valueLine1-col2",
> "valueLine1-col3", "valueLine1-col4"]
> ["valueLine2-col1" ,"valueLine2-col2",
> "valueLine2-col3", "valueLine2-col4"]
> ["valueLine3-col1" ,"valueLine3-col2",
> "valueLine3-col3", "valueLine3-col4"]
> ["valueLine4-col1" ,"valueLine4-col2",
> "valueLine4-col3", "valueLine4-col4"]
> 
> 
> so that , my table can generate 4 <tr>  and list out
> 4 <td> of the value in
> each row.
> may i know how to make it work?
> 
> Thank you
> Regards,
> Tan




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to