cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yves Vindevogel <yves.vindevo...@implements.be>
Subject Re: Table with multiple rows in xsp:logic
Date Tue, 26 Apr 2005 08:04:37 GMT
Ok, that is valid code.  How do I store my query results in a List ?
I'm not a Java programmer.

On 26 Apr 2005, at 09:17, Nathaniel Alfred wrote:

> Don't try to fake tags.  The beauty of XSP is that it guarantees 
> wellformed output (if there are no exceptions thrown).
>  
> Instead store the query result upfront in a List and then use a double 
> nested loop:
>  
> <xsp:logic>
>   for( int outer = 0; outer &lt; idList.length(); outer += 4 ) {
>     <tr>
>        <xsp:logic>
>           for( int inner = 0; inner &lt; 4; inner++ ) {
>              int index = outer+inner;
>              String id = index &lt; idList.length() ? 
> (String)idList.get(index) : "&160;";
>              <td>
>                 <xsp:expr>id</xsp:expr>
>              </td>
>           }
>        </xsp:logic>
>     </tr>
>   }
>  
> HTH, Alfred.
>> -----Original Message-----
>> From: Yves Vindevogel [mailto:yves.vindevogel@implements.be]
>> Sent: Montag, 25. April 2005 21:32
>> To: users@cocoon.apache.org
>> Subject: Table with multiple rows in xsp:logic
>>
>> Hi,
>>
>> What I want to do is pretty basic.
>> I have a loop in my results to show them inside a table
>> Every four columns, I want to start a new row.
>>
>> How can I do this ?
>>
>> The code below shows what I try to do, but does not work. (And it's 
>> not the == instead of the modulo)
>> I'm just trying stuff in there.
>>
>>
>>
>> <table>
>>
>> <tr>
>> <esql:row-results>
>> <xsp:logic>ct++ ;</xsp:logic>
>> <td>
>> <a href="#">>
>> <esql:get-string column="id"/>
>> </a>
>> </td>
>>
>> <xsp:logic>
>> if (ct == 4)
>> {
>> <xsp:text disable-output-escaping="true">&lt;tr&gt;</xsp:text>
>> } ;
>> </xsp:logic>
>> </esql:row-results>
>> </tr>
>> </table>
>>
>> Met vriendelijke groeten,
>> Bien à vous,
>> Kind regards,
>>
>> Yves Vindevogel
>> Implements
>>
>  
>  
> This message is for the named person's use only. It may contain 
> confidential, proprietary or legally privileged information. No 
> confidentiality or privilege is waived or lost by any mistransmission. 
> If you receive this message in error, please notify the sender 
> urgently and then immediately delete the message and any copies of it 
> from your system. Please also immediately destroy any hardcopies of 
> the message. You must not, directly or indirectly, use, disclose, 
> distribute, print, or copy any part of this message if you are not the 
> intended recipient. The sender’s company reserves the right to monitor 
> all e-mail communications through their networks. Any views expressed 
> in this message are those of the individual sender, except where the 
> message states otherwise and the sender is authorised to state them to 
> be the views of the sender’s company.
>
>
Met vriendelijke groeten,
Bien à vous,
Kind regards,

Yves Vindevogel
Implements


Mime
View raw message