You probably need to use something like 

   <logic:equal name="orderObj" property="getOrderStatus"
value="Entered">

The name attribute in a Struts tag is always whatever you would pass
directly to getAttribute(). 

The property attribute can then be used to reference any accessor.

You might also be able to drop the scriplet reference in iterate. As a
rule, you should not need to use scriplets with the Struts tags. You can
use expressions but usually just to avoid extending an existing tag or
creating a new one. 

In this case, the Action should be setting up orders bean so that the
logic is not dependant on the page being called with a particular query
string. You could put the orders collection on the ActionForm, and then
use

<logic:iterate id='orderObj' name="${ActionForm.attribute}"
property="orders">

ActionForm properties start out by being whatever String or booleans we
need for HTML forms, but should also include whatever else is needed by
the HTML portion of the the application's API, which probably includes
the Orders attribute here.

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services



[EMAIL PROTECTED] wrote:
> 
> I've tried lots of different variations of the suggested code but always
> get:
> 
> InsertTag:doEndTag caught: javax.servlet.ServletException: Cannot compare
> null variable to value Entered
> 
> I know I data in orderStatus because if prints out if I take out the
> conditional logic.
> 
> I'm using struts 1.0 if that makes any difference. Here's my latest try:
> 
>  <logic:iterate id='orderObj' collection='<%= request.getAttribute
> ("orders")  %>'>
>         <tr class=lstLine1>
>             <td align=left width=70>
>                 <bean:write name="orderObj" property="orderID"
> filter="true"/>
>             </td>
>             <td>
>                 <bean:write name="orderObj" property="orderStatus"
> filter="true"/>
>             </td>
>             <td>
>                 <logic:equal name="orderObj.getOrderStatus" value="Entered">
>                     <html:multibox property='selectedOrders'
> disabled="false"/>
>                 </logic:equal>
>                 <logic:notEqual name="orderObj.getOrderStatus"
> value="Entered">
>                     <html:multibox property='selectedOrders'
> disabled="true"/>
>                 </logic:notEqual>
>                     <bean:write name="orderObj" property="orderID"
> filter="true" />
>                 </html:multibox>&nbsp;
>             </td>
>         </tr>
>     </logic:iterate>
> 
> ------------------------
> I'd use something like
> 
> <logic:equal name="getOrderStatus" value="0">
> <html:multibox property='selectedOrders' disabled="true"/>
> </logic:equal>
> <logic:equal name="getOrderStatus" value="1">
> <html:multibox property='selectedOrders' disabled="false"/>
> </logic:equal>
> 
> [EMAIL PROTECTED] wrote:
> >
> > How do I dynamicly set the disabled property of a checkbox? Here's what
> > I've tried.  ANy help would be appreciated.
> >
> > <logic:iterate id='orderObj' collection='<%= request.getAttribute
> > ("orders")  %>'>
> >         <tr class=lstLine1>
> >             <td align=left width=70>
> >                 <bean:write name="orderObj" property="orderID"
> > filter="true"/>
> >             </td>
> >             <td>
> >                 <bean:write name="orderObj" property="orderStatus"
> > filter="true"/>
> >             </td>
> >             <td>
> >                 <html:multibox property='selectedOrders' disabled="<%
> >                         if (orderObj.getOrderStatus() == "Shipped")
> >                                 System.out.print("true");
> >                         else
> >                                 System.out.print("false");%>">
> >                     <bean:write name="orderObj" property="orderID"
> > filter="true" />
> >                 </html:multibox>&nbsp;
> >             </td>
> >         </tr>
> >     </logic:iterate>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to