Retain target list values in Picklist

UI Components for JSF
Post Reply
mainak1990
Posts: 22
Joined: 07 Jan 2016, 13:22
Location: Kolkata

23 Aug 2016, 08:21

Hi,

I have one drop down list and a pick-list. Upon the selection from the drop down list I have used Ajax event to populate the pick-list.
Now I have selected 2-3 values from source list to target list from the pick-list. But when I am again selecting a different option from the drop down the entire pick-list is getting updated. The previously selected target values are gone.

My requirement is to retain those values in the target box in pick-list and changing the source upon selecting from drop down. I have used Ajax event and update the pick-list id.

Please, anyone having any idea let me know asap.
Mainak Mukherjee
Kolkata, India
Programmer / Web Developer
PrimeFaces 5.2 / PF Extensions 3.2.0
JSF 2.2 / IBM WebSphere Portal 7.x

mainak1990
Posts: 22
Joined: 07 Jan 2016, 13:22
Location: Kolkata

24 Aug 2016, 06:44

Can anyone please suggest on this? I am stuck due to this.

Anyone's help is appreciated.
Mainak Mukherjee
Kolkata, India
Programmer / Web Developer
PrimeFaces 5.2 / PF Extensions 3.2.0
JSF 2.2 / IBM WebSphere Portal 7.x

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

24 Aug 2016, 09:00

currently not possible.
A possible solution would be to enhance the DualListModel to set a selected flag for each item.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

smokeybandit
Posts: 277
Joined: 08 Jul 2013, 17:53

24 Aug 2016, 16:19

It seems like something you could do with just two separate lists and some bean methods to handle the scenario

mainak1990
Posts: 22
Joined: 07 Jan 2016, 13:22
Location: Kolkata

25 Aug 2016, 20:04

smokeybandit wrote:It seems like something you could do with just two separate lists and some bean methods to handle the scenario
Hi,

Primefaces picklist is having 2 lists by default. Source and target list. My requirement is to retain the values which has been selected from the source list and pushed to target list then change the drop-down option and re populate the updated source list while keeping the previous selection in the target list in UI.
Mainak Mukherjee
Kolkata, India
Programmer / Web Developer
PrimeFaces 5.2 / PF Extensions 3.2.0
JSF 2.2 / IBM WebSphere Portal 7.x

smokeybandit
Posts: 277
Joined: 08 Jul 2013, 17:53

25 Aug 2016, 22:28

Yes, and you'll have to get creative with either how you populate the source list from the dropdown or how to maintain the target list in order to do what you want.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 59 guests