Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I see some problems with your code. In the getter, you are reconstructing the DualList from the database, reseting any changes you've done so far.</p> <p>try making you getter something like this:</p> <pre><code>public DualListModel&lt;Course&gt; getCourseModel() { return this.courseModel; } </code></pre> <p>Construct and load your list from the database in a method annotated @PostConstruct rather than in the constructor+getter.</p> <pre><code>public CourseBean() {} @PostConstruct public void init() { List&lt;Course&gt; target = new ArrayList&lt;Course&gt;(); courseModel.setSource(getCourseList()); courseModel = new DualListModel&lt;Course&gt;(source, target); } </code></pre> <p>Also annotate your bean @ViewScoped, so you dont construct a new bean with empty target-list on every request</p> <pre><code>@ManagedBean(name="courseView") @ViewScoped public class CourseBean { } </code></pre> <p>Finally you also need a setter:</p> <pre><code>public void setCourseModel(DualListModel&lt;Course&gt; courseModel) { this.courseModel = courseModel; } </code></pre> <p>I have not really looked into the converter, when I did a picklist lasttime i took the converter included in primefaces showcase (Never tried the omnifaces one). Here is a link to the source: <a href="http://code.google.com/p/ind/source/browse/indicadorCensoJSF/src/ve/gob/ine/censo/beans/convert/PrimeFacesPickListConverter.java?spec=svn154&amp;r=154" rel="nofollow noreferrer">http://code.google.com/p/ind/source/browse/indicadorCensoJSF/src/ve/gob/ine/censo/beans/convert/PrimeFacesPickListConverter.java?spec=svn154&amp;r=154</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload