title: Primefaces: How to persist reordered data from a p:orderList?
body: <p>I am still working on with the primefaces component p:orderlist.
  I have managed to implement a drag and drop behaviour (to put items from another list in to the p:orderlist) and I also make the p:commandButton work inside the p:orderlist.</p>
  
  <p>Now I have a new problem. You can drag and drop items inside the p:order list, to give them a new order. (That is, why the component is called orderlist, nothing to do with a shopping order ;-) ).</p>
  
  <p>But if I reorder my items I get no notification or event, which tells my bean, that something was changed.</p>
  
  <p>Has anybody an idea how to make this possible?</p>
  
  <p>Here is my p:orderlist, like it looks know:</p>
  
  <pre><code> &lt;h:panelGroup&gt;
  
             &lt;p:remoteCommand name="removeTechniker" actionListener="#{systemlandschaftRessourceHandler.removeTechnikerByRemoteCommand}"
                       out="technikersTable" update="@form"/&gt;
  
             &lt;p:orderList id="technikersTable"
                          value="#{systemlandschaftRessourceHandler.entity.technikers}" 
                          var="_techniker"  
                          itemValue="#{_techniker}" 
                          converter="#{entityConverter}"
                          controlsLocation="none"&gt;  
  
                  &lt;f:facet name="caption"&gt;Techniker&lt;/f:facet&gt;  
  
                  &lt;p:column&gt;    
                      &lt;p:commandButton id="deleteTechnikerFromListButton" 
                                      styleClass="colButton" 
                                      icon="ui-icon-trash" 
                                      type="button" 
                                      onclick="removeTechniker([{name:'id', value:'#{_techniker.id}'}]);"
                                      update="@form"/&gt;
                  &lt;/p:column&gt;
                  &lt;p:column style="width:75%;" id="outTech"&gt;  
                     &lt;p:outputLabel value="#{_techniker.verantwortlich.displayName}"/&gt;
                  &lt;/p:column&gt;
  
              &lt;/p:orderList&gt;
  
              &lt;p:droppable id="technikerDrop" 
                          for="technikersTable" 
                          tolerance="touch" 
                          activeStyleClass="ui-state-highlight" 
                          datasource=":systemLandschaftTabView:sysObjektDetailPanelForm:userTable" 
                          scope="userDraggable"&gt;  
                      &lt;p:ajax listener="#{systemlandschaftRessourceHandler.onDropTechniker}" update="@form" /&gt;  
              &lt;/p:droppable&gt;  
              &lt;/h:panelGroup&gt;
  </code></pre>
  
  <p>I already found something on the primefaces community, but this doesn't work, can' even say why.
  Link: <a href="http://forum.primefaces.org/viewtopic.php?f=3&amp;t=26539" rel="nofollow noreferrer">http://forum.primefaces.org/viewtopic.php?f=3&amp;t=26539</a></p>
  
  <p>Regards 
  LStrike</p>
  
  <p>Just for info, here are my solved items, regarding the p:orderlist:</p>
  
  <p><a href="https://stackoverflow.com/questions/19381239/primefaces-commandbutton-inside-orderlist-not-working">Primefaces: CommandButton inside Orderlist not working</a></p>
  
  <p>and</p>
  
  <p><a href="https://stackoverflow.com/questions/19399760/primefaces-orderlist-index-out-of-bound-exception-while-reordering">Primefaces: Orderlist: index out of bound exception while reordering</a></p>