Moving data between two PrimeFaces datatables
===

I have two datatables, one with available records and another with assigned records. They have a behaviours similar to the Primefaces's `<p:picklist>`. Both datatables have multiple selection. When a button is pressed the selected records are moved from one datatable to another. The selected records are stored in an array like in the  [sample from multiple selection][1].

I have noticed that a hidden field, with an id formed from the name of the datatable and terminated with __selection_ is used to store the selection. The problem appears when repeating the moving action. The new selection is added to the previous one. Because of this the selection array contains some null values.

How can I clear the hidden input after the moving operation finished? 


  [1]: http://www.primefaces.org/showcase-labs/ui/datatableRowSelectionRadioCheckbox.jsf