Hi,
I've used a scriptlet as follows to achieve what I want, but I'd rather user
the struts tags if possible
<struts_logic:iterate id="element" name="rows">
<%
if ( element.equals( "true" ) )
{
out.println( "<td class=row><input type=checkbox
checked></td>" );
}
else if ( element.equals( "false" ) )
{
out.println( "<td class=row><input
type=checkbox></td>" );
}
else
{
out.println( "<td class=row>" + element + "</td>" );
}
%>
</struts_logic:iterate>
If anyone knows how to do this using the struts logic tags then let me know.
Richard.
-----Original Message-----
From: Richard Murray [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 04, 2001 10:30 AM
To: [EMAIL PROTECTED]
Subject: nesting logic:equals tags
Hi,
I'm iterating over an array of Strings containing the following dummy data {
"1", "2", "3", "4", "true", "6", "7"}. I want to apply the following logic:
if the String is "true" or "false" display a checkbox, else display the
String.
I attempted to nest the tags as follows, but this does not work:
<struts_logic:equal value="true" name="element">
<struts_logic:equal value="false" name="element">
<td class=row><input type=checkbox></td>
</struts_logic:equal>
</struts_logic:equal>
I can only get this working as shown below:
<struts_logic:iterate id="element" name="rows">
<struts_logic:equal value="true" name="element">
<td class=row><input type=checkbox checked></td>
</struts_logic:equal>
<struts_logic:equal value="false" name="element">
<td class=row><input type=checkbox></td>
</struts_logic:equal>
</struts_logic:notEqual value="true" name="element">
</struts_logic:notEqual value="false" name="element">
<td class=row><struts_bean:write
name="element"/></td>
</struts_logic:equal>
</struts_logic:equal>
</struts_logic:iterate>
However, this does not work properly as I have nested the notEquals logic
tags.
Is there a way to nest these tags or supply conditional operators ( e.g. &&,
|| ). Is there anyway to supply an else statement. I'm not sure I can
achieve what I want with these tags and may be better of with a scriptlet.
Hope someone can help.
Richard.
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager at [EMAIL PROTECTED]
This footnote also confirms that this email message has been swept by
for the presence of computer viruses.
http://www.qspgroup.com
**********************************************************************