I’m quite new to primefaces and i ran to this issue with p:draggable commponent.
This is my web site using p:draggable component exactly as in primefaces showcases.
<p:fieldset legend="PreparedData">
<p:dataGrid id="currentData" columns="1" var="res" value="#{SomeBean.data}">
<p:column>
<p:panel id="draggedres" header="#{res.name}">
<h:panelGrid columns="1">
<h:outputText value="#{res.name}"/>
</h:panelGrid>
</p:panel>
<p:draggable for="draggedres" />
</p:column>
</p:dataGrid>
</p:fieldset>
<p:commandButton value="Add" actionListener="#{SomeBean.addItem}" update="currentData" />
Theres my bean SomeBean.
public class SomeBean{
private List<SomeObjects> data = new ArrayList<SomeObjects>();
public void addItem(){
data.add(new SomeObjects("someName"));
}
//GETTERS SETTERS
}
Now the problem is that when i add new data to that List it appears BUT is not draggable. Only way how to make those data draggable is to set them into constructor of that bean.
Anyone know where did i make mistake? I already read Primefaces manual but theres nothing about it. In there they just silently assume that data will be set only from contructor.
Thanks for any answers.
The example code you submitted is working just fine. Check the code you are using, sometimes in an attempt to obfuscate code data (like variable names, package names that could contain sensitive info), we omit or alter something related to the bug at hand.
This is the code (ipsis literis) I used to test your example:
SomeBean.java
SomeObject.java
draggable.xhtml