This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes TreeTable and row selection 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 » Java » JSF
Bookmark "TreeTable and row selection" Watch "TreeTable and row selection" New topic

TreeTable and row selection

brent broussard

Joined: Mar 09, 2006
Posts: 2
I have a tree table and it renders fine. I added a column at the end of the table to place an Edit Icon on each row. The commandLink the surrounds the image has an actionListener and it fires, however, it returns the an index that is from the last row in the treetable that is expanded instead of what row i was really on. If I have a root node and do not expand the tree, it works. If I expand the tree and click on the same row, different results. Upon inspection of the HTML source, I noticed that the edit Icon has the same id rendered for every row. I took off the id to let JSF render me one and it is also the same for every edit icon. Oh, I forgot to mention that I placed an f aram tag inside the commandLink and the source has the right information that I would have expected. Does the <t:tree2> tag support treeColumn's?

Any clue?
brent broussard

Joined: Mar 09, 2006
Posts: 2
I ended up finally getting this to work, with a big work around. I attempted to use the forceIdIndex and forceId to let JSF one up my id with no luck. I had to place two hidden fields on my page, one for the row type and one for the unique id. Then, in the onmousedown event I set these two fields and was able to retrieve them successfully in my backing bean. I totally removed the actionListener and param fields.
I agree. Here's the link:
subject: TreeTable and row selection
Similar Threads
JTreeTable Selection
Trinidad's treeTable tag.
JTreeTable - tree of DefaultMutableTreeNodes
CommandLink ActionListeners in DataTable
expand table row