aspose file tools*
The moose likes Struts and the fly likes DisplayTag and logic:match Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "DisplayTag and logic:match" Watch "DisplayTag and logic:match" New topic
Author

DisplayTag and logic:match

Beksy Kurian
Ranch Hand

Joined: Jul 11, 2001
Posts: 254
Hi,
I am trying to convert the following code (1) to (2) so that it will use displayTag for presentation.
The logic:match tag inside the displayTag keeps complaining that it cannot find the property in the bean.
The code(1) works. and code(2) works without logic:match tag. I need to use logic:match tag to compare the values and form
(or not form) the links for the account. Does logic:match work with displayTag or am I missing anything in my code?
Please help!
(1)
<bean efine id="acctlist" name="<%=InvestAction.getINVEST_ACCT_KEY()%>" scope="session" />
<logic:iterate id="acct" name="acctlist">
<tr class="even">
<logic:notMatch name="acct" property="gts" value="Y">
<td>
<html:link href="ActDetail.do" paramId="acct" paramName="acct" paramProperty="acctNum">
<bean:write name="acct" property="acctNum" />
</html:link>
</td>
</logic:notMatch>
<logic:match name="acct" property="gts" value="Y">
<td>
<bean:write name="acct" property="acctNum" />
</td>
</logic:match>

</tr>
<tr class="odd"><td colspan=3></tr>
</logic:iterate>


(2)


<display:table id="failed"
requestURI="acctList.do?paging=true"
name="sessionScope.INVEST_ACCT_KEY" pagesize="15" sort="list" export="true">
<logic:notMatch name="InvestAction.getINVEST_ACCT_KEY()" property="gts" value="Y">
<display:column property="acctNum" title="Acct" sortable="true" headerClass="sortable"
href='<%=InvestAction.getUrlRoot() + "ActDetail.do"%>'
paramProperty="acctNum" paramId="acct"/>
</logic:notMatch>
<logic:match name="InvestAction.getINVEST_ACCT_KEY()" property="gts" value="Y">
<display:column property="acctNum" title="Acct"
sortable="true" headerClass="sortable" />
</logic:match>

<display:setProperty name="sort.behavior" value="list"/>
<display:setProperty name="paging.banner.include_first_last" value="true"/>
</display:table>


Thanks
Beksy
[ July 27, 2004: Message edited by: Beksy Kurian ]
Shankar Narayana
Ranch Hand

Joined: Jan 08, 2003
Posts: 134
<br>

Hi, <br>

what do this code <%=InvestAction.getINVEST_ACCT_KEY()%> return to you,
is it a bean, or only a property. As far as the code is concerned, it would
work fine if this id="acctlist" holds a bean reference. Try to look into it
probably your error lies there.


"Failure is not when you fall down; its only when you fail to get up again."
Beksy Kurian
Ranch Hand

Joined: Jul 11, 2001
Posts: 254
Thanks Shankar for the reply. It is the bean reference. As I said before code(1) works and it is correctly displaying links to acctNum if property 'gts' is anything other than 'Y'. I want that set of code work with display tag instead of struts logic:iterate tag. When I put logic:match, inside displayTag, it is giving the error(no property gts in the bean). I am using the same bean there too.
Awaiting a reply
Beksy
Shankar Narayana
Ranch Hand

Joined: Jan 08, 2003
Posts: 134


Hi,

First of all let me tell you that i haven't used the display tag, anyway I found there are 2 places where the error might be lying.

1.

This code might reference the bean defined by the name attribute, bcos it the way display tag works. If not your error lies here.

2.

In this code the logic tag looks for an bean instance with the name you gave at the "name" attribute, but since you haven't defined any bean by
this name, it is not able to find the property. Hope this takes into a new direction to solve your problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DisplayTag and logic:match