tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Shead <Ma...@reslife.org>
Subject RE: Tag support for:
Date Wed, 25 Jul 2001 14:03:11 GMT
I don't know the answers to all your questions, but if you look at the
DBtags they have a way to request a set of rows and loop over them until
they are all printed.

For example:
<table>
<sql:statement id="stmt1" conn="conn1"> 
  <sql:query>
    select r.*, 
        case when (select 1 
                   from req_approvals ra 
                   where ra.req_id = r.req_id and 
                       approved = 'f') is not null 
             then 'rejected' 
             when (select 1 
                   from req_approvals ra 
                   where ra.req_id = r.req_id and 
                       approved is null) is not null 
             then 'pending' 
             else 'approved' end as approved 
    from req_req r

  </sql:query>
  <%-- loop through the rows of your query --%>
  <sql:resultSet id="rset2">
    <tr>
      <td><sql:getColumn position="1"/></td>
      <td><sql:getColumn position="2"/></td>
      <td><sql:getColumn position="3"/></td>
      <td><sql:getColumn position="4"/></td>
      <td><sql:getColumn position="5"/></td>
    </tr>
  </sql:resultSet>
</sql:statement>
</table>

Will produce as many rows as the query contains.

Hope that helps.

Mark

-----Original Message-----
From: Casazza, Robert [mailto:CasazzR@divinvest.com]
Sent: Tuesday, July 24, 2001 12:48 PM
To: 'taglibs-user@jakarta.apache.org'
Subject: Tag support for:



Maybe this is more related to Struts but I'm
curious as to whether Jakarta Tags allow:

[1] looping, in particular to be able to dynamically
	populate a table based on a collection of
	objects with attributes

[2] What general ways are there to populate tables
	with exactly X columns?

[3] Are there currently tags which look like checkboxes
	or radio buttons but which force a refresh to
	allow the current page to dynamically change
	based on the choices made?

Thanks.

Mime
View raw message