两个 ICEfaces 面板交互定位
如何限制 PanelPositioned 的元素,使其只能在当前面板内拖动?我有两个不同数据类型的垂直列表,一个在另一个之上。两者都使用 PanelPositioned 来允许拖动和拖动。删除重新排序,但可以将元素上下拖动到另一个面板,从而生成错误
<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>
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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于icefaces 3.0,将
beforeChangeListener
添加到ice:panelPositioned
元素。如果event.getType() !=
为PanelPositionedEvent
。TYPE_MOVE
,则此侦听器应调用event.cancel()
> 并且event.getIndex()
和event.getOldIndex()
都大于 1。如果是移动,则它在面板内。添加/删除正在面板之间移动。对于icefaces 1.8.2(从未使用过2.0),您需要向
ice:panelPositioned
元素添加一个侦听器。没有beforeChangeListener
。您将需要一份之前的清单和当前的清单(两份)。初始化支持 bean 时,两者都初始化为相同的元素。侦听器,如果移动 - 将之前列表设置为当前列表,否则将当前列表设置为之前列表。必须是副本,而不是参考。For icefaces 3.0, add a
beforeChangeListener
to theice:panelPositioned
element. This listener should then callevent.cancel()
if theevent.getType() !=
toPanelPositionedEvent
.TYPE_MOVE
and 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:panelPositioned
element. 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.