You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Geeta Ramani <ge...@cmpco.com> on 2004/02/23 19:44:43 UTC

Re: tag doesn't recognize Struts dataBean property'svalue

Jumping in here.. yes, I think you need to trim() before you check.  Also, if
that too doesn't work, can you check for something "positive" (like if
"ShopOrderExist" is equals to "false" rather than "ShopOrderExist" is not equals
to "not exists"..?).

Another thought, try to get this to work just using oridinary jsp tags and java
code (<% java code here %>) and see oif things work. Than you can narrow the
problem down to tag issues..

Good luck!
Geeta

"Au-Yeung, Stella H" wrote:

> Niall:
> I did what you suggested and print out the value of the property
> "shopOrderExist".  It is equal to "notExist" as expected.   But somehow the
> "Update link" is still displayed instead of the "Create link".  Do you think
> I have to do something to the value of "shopOrderExist" such as .trim() or
> convert to "true" before letting it be compared in the logic:equal tag?
>
> <logic:iterate id="sequenceList"
> collection="<%=ShopWorkOrderSearchFormBean.getPage()%>"
>         type="com.cat.fdd.dataBean.shopWorkOrder.ShopWorkOrderSearchBean">
>   <tr>
>
>     <td class="listCell"><bean:write name="sequenceList"
> property="sequence"/> </td>
>     <td class="listCell"><bean:write name="sequenceList"
> property="shopOrderExist"/></td>   <======== ADDED
>
>     <td class="listCell"><nobr>
>     <!-- If the ShopOrderExist attribue is not equal to "notExist", display
> Create link ,otherwise Update link-->
>     <logic:equal name="sequenceList" property="shopOrderExist"
> value="notExist">
>            <a href="app/fdd/shopWorkOrder/CreateShopWorkOrderRequest.exec">
>            <img src="images/icoAdd.gif" border="0"></a>
>     </logic:equal>
>
>     <logic:notEqual name="sequenceList" property="shopOrderExist"
> value="notExist">
>     <a href="app/fdd/shopWorkOrder/UpdateShopWorkOrderRequest.exec">
>     <img src="images/icoEdit.gif" border="0"></a>
>     </logic:notEqual>
>     </td>
>
>   </tr>
> </logic:iterate>
>
> -----Original Message-----
> From: Niall Pemberton [mailto:niall.pemberton@blueyonder.co.uk]
> Sent: Monday, February 23, 2004 11:16 AM
> To: Struts Users Mailing List
> Subject: Re: <html:logic> tag doesn't recognize Struts dataBean property's
> value
>
> I doubt the problem is <logic:equal>.
>
> Your jsp looks OK - why not try outputting the "shopOrderExist" property in
> your table (along with yhe other stuff) - something along the lines of:
>
> <td class="listCell"><bean:write name="sequenceList"
> property="shopOrderExist"/></td>
>
> That way, you can see the value the <logic:equal/notEqual> is testing
> against.
>
> Niall
>
> ----- Original Message -----
> From: "Au-Yeung, Stella H" <st...@eds.com>
> To: <st...@jakarta.apache.org>
> Sent: Monday, February 23, 2004 3:34 PM
> Subject: <html:logic> tag doesn't recognize Struts dataBean property's value
>
> > Hi:
> > In my struts-based application I am using a <html:logic> tag in my JSP
> page
> > to print two links depends on the value of a struts-based databean's
> > property. Bacially on this JSP page, a list of records wil be
> > displayed. Next to each record, either a "Create" link or an "Update"
> > link should be displayed depends upon the property '"shopOrderExist".
> > If this property
> has
> > the value "notExist", it should display the "Create" link. If it is
> > not equal to "notExist", it should display the "Update" link. For some
> > reason, the "Update" link is always displayed even though
> > "shopOrderExist" has a value of "notExist". So the logic:equal tag is
> > not comparing things correctly. Am I doing it wrong? (note, the
> > property "shopOrderExist" is of type String and in Debug I see that
> > its value is "notExist")
> >
> > Here's my code:
> > <logic:iterate id="sequenceList"
> > collection="<%=ShopWorkOrderSearchFormBean.getPage()%>"
> > type="com.cat.fdd.dataBean.shopWorkOrder.ShopWorkOrderSearchBean">
> > <tr>
> > <td class="listCell"><bean:write name="sequenceList"
> > property="sequence"/> </td>
> >
> > <!-- If the ShopOrderExist attribue is not equal to "notExist",
> > display Create link ,otherwise Update link--> <logic:equal
> > name="sequenceList" property="shopOrderExist"
> value="notExist">
> > <a href="app/fdd/shopWorkOrder/CreateShopWorkOrderRequest.exec">
> > <img src="images/icoAdd.gif" border="0"></a>
> > </logic:equal>
> > <logic:notEqual name="sequenceList" property="shopOrderExist"
> > value="notExist"> <a
> > href="app/fdd/shopWorkOrder/UpdateShopWorkOrderRequest.exec">
> > <img src="images/icoEdit.gif" border="0"></a> </logic:notEqual>
> > </td>
> > </tr>
> >
> > Thanks in advance!
> > Stella
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org