Jsf Primefaces可从动态生成的datatable拖放到不同面板中的datatable

Jsf Primefaces可从动态生成的datatable拖放到不同面板中的datatable,jsf,primefaces,datatable,droppable,Jsf,Primefaces,Datatable,Droppable,我正试着在一些桌子上拖拽。源表是从selectOneMenu->AccordianPanel->datatable动态生成的。我可以通过数据源中下面列出的直接路径从droppable指向它,但是在删除attribValue文本时,我会得到一个noRowAvailableException。有没有找到解决方案的思路?如果我遗漏了一些需要知道的东西,我道歉,我会根据需要更新。多谢各位 <p:accordionPanel value="#{testBean.attributeList}" var

我正试着在一些桌子上拖拽。源表是从selectOneMenu->AccordianPanel->datatable动态生成的。我可以通过数据源中下面列出的直接路径从droppable指向它,但是在删除attribValue文本时,我会得到一个noRowAvailableException。有没有找到解决方案的思路?如果我遗漏了一些需要知道的东西,我道歉,我会根据需要更新。多谢各位

<p:accordionPanel value="#{testBean.attributeList}" var="attribute" id="attribute" >
                                    <p:tab title="#{attribute.displayName}">
                                        <p:dataTable value="#{attribute.valuesList}" var="attribValue" id="attribValue" selectionMode="single" rowKey="#{attribValue}" selection="#{testBean.attribValue}">
                                            <p:column>
                                                <script type='text/javascript'>
                                                    $(".myDraggables").draggable({
                                                        helper: function() {
                                                            return $(this).clone().appendTo('body').css('zIndex', 5).show();
                                                        }
                                                    });
                                                </script>
                                                <h:outputText value="#{attribValue.name}" class="myDraggables" id="actualValue"/>
                                                <p:draggable for="actualValue" revert="true"  />
                                            </p:column>
                                        </p:dataTable>
                                    </p:tab>`
                                </p:accordionPanel>

$(“.myDraggables”).draggable({
助手:函数(){
返回$(this.clone().appendTo('body').css('zIndex',5.show();
}
});
`
这是放置位置:

<p:dataTable value="#{testBean.subscriptions}" var="subscripList" id="subscriptions">
                                <p:column style="width:648px">
                                    <script type='text/javascript'>
                                        $(".myDroppables").droppable({
                                            accept: '.myDraggables'
                                        });
                                    </script>
                                    <f:facet name="header">
                                        Product Subscriptions
                                    </f:facet>
                                    <h:outputText id="destination" value="#{subscripList.name}" class="myDroppables" />
                                    <p:droppable for="subscriptions" datasource=":mainForm:form:attribute:attribValue">
                                        <p:ajax process="subscriptions" listener="#{testBean.onDrop}" update="subscriptions" />
                                    </p:droppable>
                                </p:column>
                            </p:dataTable>

$(“.myDroppables”).droppable({
接受:'.MyDragables'
});
产品订阅

您必须手动初始化bean中的destination list变量

在testBean中,只需替换

List subscriptions; 

List subscriptions=new ArrayList();
List subscriptions = new ArrayList<>();