This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

displayTag and finishRow() method

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All:
I am hoping my problem is something to do with the Java piece. Here goes:
I followed the instructions in this post : http://stackoverflow.com/questions/2705790/creating-a-drop-down-row-in-displaytag


I have a working application wherein I use displaytag. In a decorator, I add links to each row -- works great. Now I have added a finishRow method to my decorator. It looks like this.

It is NOT invoked for the first row. But for all others, it is. Thus when I Click on the link to show the first row's details, nothing is shown. If I click on the link in the second row, I get the My Filters row for the first row.

Here is the decorator code



When I debug, I see that I roll through the getLink2() code once, then see several iterations of getLink2 followed by finishRow. Why no invocation of finishRow for the first iteration of getLink2()?
 
author & internet detective
Posts: 39528
776
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where does id come from? Is it possible you have an index beginning with 0 vs 1 problem?
 
stephen r davidson
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, thanks for the reply.
Here is the full decorator, followed by sysout messages. I will also post the jsp. There are a total of 6 rows. Not in the sysout that it seems the finishRow() method is entered twice for the last row. I don't understand why, but it is another piece of the puzzle:



The sysout:

in getLink2 and id is 10
logged in as administrator
davst12
in getLink2 and id is 9
logged in as administrator
davst12
in finishRow and id is : 9
in getLink2 and id is 8
logged in as administrator
davst12
in finishRow and id is : 8
in getLink2 and id is 7
logged in as administrator
davst12
in finishRow and id is : 7
in getLink2 and id is 6
logged in as administrator
davst12
in finishRow and id is : 6
in getLink2 and id is 4
logged in as administrator
davst12
in finishRow and id is : 4
in finishRow and id is : 4

The jsp:



So maybe I don't understand how finishRow() gets invoked? I though I just needed to have the method in my decorator and after each row, it would execute?

 
stephen r davidson
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry. Ignore last post. I looked for a way to edit it but could not see how to do that.

Anyway

Decorator is :


jsp is:

 
stephen r davidson
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the html created by the code.

 
stephen r davidson
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is better ....




 
Everybody's invited. Even this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!