swapbox - List Item Provider for Selected Options

I found this control swapbox rather strange. The Swapbox control provides a value property that seems to bind to a string or string .

What I’ve done is

a) placed a swapbox control
b) added a Select Item Group Provider
c) implemented a method to return SelectItem
d) attached this list to the Item Group ‘value’ property
e) attached a String to the ‘value’ property of swap box

On UI it works as long as the user is on the page. When user goes to another page , I refresh to populate the SelectItem only with those values that are still available [excluding the selected ones]

I get a strange error ( proabably I cant populate the items that are selected, whose values are bound to a string )

My question is - how do we persist the state of selected/available options in a swap box

The Option Group value - the one bound to SelectItem is basically a selection choice (think about that Swapbox is an advanced version of multi-select list). So it has to return all choices: both selected and unselected.

To preserve selection state you need to preserve a submitted value of swapbox control which are being submitted from any command action.


The Control Value field of swap box takes a String which is essentially the list of swapped values.