Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

selectManyListbox question

 
Ruther Ford
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am new to jsf.
I've two selectManyListboxes and I need to move the values from
one selectManyListbox to another.
From the bean I am passing the values to the selectManyListbox are of
SelectItem[] type values.
Could anybody explain me that how to do this
any help is appreciated.

thanks and regards
 
Ruther Ford
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any help
 
Kumar Saravanan
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ruther,

Say you have 2 selectManyListBox, one is source and another is destination.

Create a property in your backing which is of type Map and bind it to your source selectManyListBox and do the same for destination selectManyListbox. During the initial load the destination one will be empty.

Use Ajax to show the selected item from the source to destination.

Since you are binding the selected value(s) to a property in your backing bean you can easily access the value in another selectManyListBox.

Thanks,
Kumar Saravanan
 
narender sunkam
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kumar Saravanan,
Thanks for your reply.
My problem is I've the SelectItems[] values then how to add or remove the values I didn't find any such method for SelectItem[].I found only length for that.
Please could explain me with a small example.
Here I am sending the code


Here is the jsp code

>
 
Andres Quinones
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ruther, maybe you could try using Sandbox component selectManyPicklist.
Here you have an example http://www.irian.at/myfaces-sandbox/picklist.jsf.

I hope this helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic