Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>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.</p> <p>This is the code (ipsis literis) I used to test your example:</p> <p>SomeBean.java</p> <pre><code>import java.util.ArrayList; import java.util.List; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; @ManagedBean @ViewScoped public class SomeBean { private List&lt;SomeObjects&gt; data = new ArrayList&lt;SomeObjects&gt;(); public void addItem(){ data.add(new SomeObjects("someName")); } public List&lt;SomeObjects&gt; getData() { return data; } public void setData(List&lt;SomeObjects&gt; data) { this.data = data; } } </code></pre> <p>SomeObject.java</p> <pre><code>public class SomeObjects { private String name; public SomeObjects(String string) { this.setName(string); } public void setName(String name) { this.name = name; } public String getName() { return name; } } </code></pre> <p>draggable.xhtml</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:c="http://java.sun.com/jsp/jstl/core"&gt; &lt;h:head&gt; &lt;/h:head&gt; &lt;h:body&gt; &lt;p:separator styleClass="espacador" /&gt; &lt;p:fieldset legend="PreparedData"&gt; &lt;p:dataGrid id="currentData" columns="1" var="res" value="#{someBean.data}"&gt; &lt;p:column&gt; &lt;p:panel id="draggedres" header="#{res.name}"&gt; &lt;h:panelGrid columns="1"&gt; &lt;h:outputText value="#{res.name}" /&gt; &lt;/h:panelGrid&gt; &lt;/p:panel&gt; &lt;p:draggable for="draggedres" /&gt; &lt;/p:column&gt; &lt;/p:dataGrid&gt; &lt;/p:fieldset&gt; &lt;p:commandButton value="Add" actionListener="#{someBean.addItem}" update="currentData" /&gt; &lt;h:body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload