1

So the scenario I have is such:

I have a person that I load up that has a list of integer values that represent all of the videos that person has watched.

For example, if person 12345 has viewed three videos, it would be represented in a list as such [4012, 2001292, 50201]

That list can be 0..x and is represented by a selectManyMenu in Primefaces.

When I load the people from the database and attempt to edit the person, instead of seeing every video that person has viewed checked in the selectManyMenu, it shows the first one and that is it. It either shows 0 or 1. Not many.

Code:

<p:selectManyMenu id="editPersonVideoList" value="#{backingBean.viewedPerson.allViewedVideos}">
    <f:selectItems value="#{backingBean.allVideos}" var="v" itemLabel="#{v.name}" itemValue="#{v.id}"/>
</p:selectManyMenu>

Any ideas...?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
user2124871
  • 803
  • 3
  • 9
  • 25

1 Answers1

0

If allViewedVideos is only integer type list , then it won't display any data. Type of the allViewedVideos should selectedItem and need to put data item label and item id format.

create a class(Ex : SelectedList) with having two fields 1. Label 2. Id. Set allViewedVideos value data to this list. Return List newList of value.

use

Shravan
  • 11
  • 3