Is this condition only available for Datable and/or DataGrid, or is it possible to get/put some data from/in a draggable/droppable element?
Code: Select all
<p:panel header="Field" styleClass="soccer_field">
<p:dataGrid id="trgField" value="#{famFormationController.lstTarget}"
var="t" columns="5"
style="padding-top: 25px;margin-left: 20px;">
<p:column>
<p:panel header="#{t.strIdx}" id="trg"
style="display:block;text-align:center;width:50px;height:63px;border:1px solid #666666;">
<p:panel id="item"
rendered="#{!empty t.famFormationItem.numItem}">
<h:outputText value="#{t.famFormationItem.numItem}"/>
</p:panel>
<p:draggable for="item" revert="true" handle=".ui-panel-titlebar" stack=".ui-panel" />
</p:panel>
<p:droppable for="trg"
tolerance="touch"
activeStyleClass="slotActive"
onDrop="handleDrop"
>
<p:ajax listener="#{famFormationController.onDrop}"
update="@form"
/>
</p:droppable>
</p:column>
</p:dataGrid>
</p:panel>
Code: Select all
public void onDrop(DragDropEvent event) {
FamFormationItem item = (FamFormationItem) event.getData();
// or anything else... for now event.getData() is always null
}
I hope I was clear...