You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Au-Yeung, Stella H" <st...@eds.com> on 2004/02/23 16:34:10 UTC

tag doesn't recognize Struts dataBean property's val ue

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


Re: tag doesn't recognize Struts dataBean property's value

Posted by "Khalid K." <gr...@maikada.com>.
There is an error in your JSP.  IF that is the complete jsp post,

then you are missing the closing iterate tag  "</logic:iterate>"

So anything between the interate tag is not being evaulated,
I bet if you look at the rendered html output source, you will actually see 
the "<logic:iterate>" tags....

Khalid



Quoting Niall Pemberton <ni...@blueyonder.co.uk>:

> 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
> 
> 


-- 
Khalid K.

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


Re: tag doesn't recognize Struts dataBean property's value

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
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