How do you constrain the elements of a PanelPositioned so they can only be dragged within the current panel? I have two vertical lists of different data types, one above the other. Both use a PanelPositioned to allow drag & drop reordering, but the elements can be dragged up and down to the other panel, generating an error
<ice:panelPositioned id="dragPanel1" var="dataType1var"
value="#{displayBean.dataType1List}" constraint="vertical">
<ice:panelGroup style="cursor:move;">
</ice:panelGroup>
</ice:panelPositioned>
<ice:panelPositioned id="dragPanel2" var="dataType2var"
value="#{displayBean.dataType2List}" constraint="vertical">
<ice:panelGroup style="cursor:move;">
</ice:panelGroup>
</ice:panelPositioned>
For icefaces 3.0, add a
beforeChangeListenerto theice:panelPositionedelement. This listener should then callevent.cancel()if theevent.getType() !=toPanelPositionedEvent.TYPE_MOVEand theevent.getIndex()andevent.getOldIndex()are both greater than 1. If it is a move, then it is within panel. add/delete are moving between panels.For icefaces 1.8.2 (neve used 2.0), you would need to add a listener to the
ice:panelPositionedelement. There is nobeforeChangeListener. you will need a before list and current list (two copies). Both initialize to same elements when initializing backing bean. The listener, if a move – set before list to current list otherwise set current list to before list. Must be a copy, not a reference.