This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JSF and the fly likes Table in a List Box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "Table in a List Box " Watch "Table in a List Box " New topic
Author

Table in a List Box

Nanda Kishore Akkala
Greenhorn

Joined: Aug 20, 2008
Posts: 3
Hi, I am new to JSF technology. I have a doubt. The following are the details.

Doubt: How to implement a tabular structure in a list box. I should be able to select the entire row like selecting an item in a list box.

My Requirement: In the left side there is a list box and two pull down lists and a add button. A row (with three elements) should be added to the table which is in the list box after selecting an item in the listbox, and in the two pull down lists and by clicking on Add button. After adding one or more rows in the list box, I should be able to select a row in the table like in list box.

Can any one please tell me whether this is possible or not. Are there any alternatives for this. Please help me.
Thank you.
arulk pillai
Author
Ranch Hand

Joined: May 31, 2007
Posts: 3220
Why not extend the JSF Table into a custome component with chckboxes on the left to select and unselect rows.


Java Interview Questions and Answers Blog | Amazon.com profile | Java Interview Books
Nanda Kishore Akkala
Greenhorn

Joined: Aug 20, 2008
Posts: 3
Hi Arul,

As per our client requirement, the requirement should be as follows.

My Requirement: In the left side there is a list box and two pull down lists and a add button. A row (with three elements) should be added to the table which is in the list box after selecting an item in the listbox, and in the two pull down lists and by clicking on Add button. After adding one or more rows in the list box, I should be able to select a row in the table like in list box (The behaviour should be like List Box).

Can you please tell me whether this is possible or not...
Can we achieve this using custom components?
Please suggest me.


Thank you.
Nanda Kishore Akkala
Greenhorn

Joined: Aug 20, 2008
Posts: 3
Can any one give suggestion regarding using a table in a list box. Or if there are any alternatives, please tell me. Thank you.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
No such component exist in a standard JSF implementation and other component libraries which I am aware of. Such an element does also not exist in standard HTML. You however can create/simulate a tabular listbox using DHTML (HTML with some Javascript which alters the HTML DOM).

First, start off with writing such a thing using DHTML. Once you got it working, then write a custom UIInput (UISelectOne? UISelectMany?) component which contains the core logic behind the component, a custom UIComponentELTag (or UIComponentTag if you're using JSF 1.1 or older) which backs the tag element and a custom Renderer which renders the desired DHTML to the response. Finally define it all in your custom TLD file so that you can use it as a new JSF taglib in your JSP file.
[ August 24, 2008: Message edited by: Bauke Scholtz ]
 
GeeCON Prague 2014
 
subject: Table in a List Box