This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

DisplayTag and logic:match

 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<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.
 
Beksy Kurian
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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.
 
The harder you work, the luckier you get. This tiny ad brings luck - just not good luck or bad luck.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic