This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

DisplayTag and logic:match  RSS feed

 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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.
 
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!