jQuery in Action, 2nd edition*
The moose likes Other Open Source Projects and the fly likes displayTag and finishRow() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "displayTag and finishRow() method" Watch "displayTag and finishRow() method" New topic
Author

displayTag and finishRow() method

stephen r davidson
Ranch Hand

Joined: Jun 23, 2013
Posts: 58
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()?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

Where does id come from? Is it possible you have an index beginning with 0 vs 1 problem?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
stephen r davidson
Ranch Hand

Joined: Jun 23, 2013
Posts: 58
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

Joined: Jun 23, 2013
Posts: 58
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

Joined: Jun 23, 2013
Posts: 58
Here is the html created by the code.

stephen r davidson
Ranch Hand

Joined: Jun 23, 2013
Posts: 58
This is better ....




 
wood burning stoves
 
subject: displayTag and finishRow() method
 
Similar Threads
parsing data and storing in the xml
Struts 2 - Http error 404
Displaytag checkbox using struts2
displayTag sorting problem
not selecting values from database