• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

displayTag and finishRow() method

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 41124
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is better ....




 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic