Improvement: save pickList highlighted items

UI Components for JSF
Post Reply
User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

28 Jul 2011, 10:59

Hello PF team,

I think, it's a little bit strange that PickList can't save highlighted items. PickList Model only operates with Lists for source / target items of any type, but information which items were chosen (I mean highlighted) gets lost. I chose e.g. one item from the target list, save the mask with PickList because I go to a next step, go back and don't see my choosen items. Selection is ok, I mean really highlighting. Native DOM option element from HTML select element has this attribut (look spec. please). PickList Model should support it too. I have proposed a long time ago to introduce PickList Item as a model class. We would have then source / target list as List<PickListItem>. PickListItem can have highlighted as attribut and data of course (like TreeNode). So, like TreeNode we need a PickListItem class. What do you think?
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

healeyb
Posts: 365
Joined: 07 Apr 2010, 16:05

28 Jul 2011, 11:24

It gets my vote, there is quite a bit of additional logic required in the
backing bean to get this working.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

28 Jul 2011, 11:28

Yes. I gave up this logic. So, if PrimeFaces team will confirm this feature, I can create an issue.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

28 Jul 2011, 14:15

This would work too

Code: Select all

<p:pickList ... highlightingSource=#{myBean.highlightedSourceItems} highlightingTarget=#{myBean.highlightedTargetItems} ...../>
analog to DataTable selection attribute. Chosen (highlighted) items belongs to the PickList state. And state should be saved! What is the difference to DataTable rows selected by user? No difference. This should work for PickList as well.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 20 guests