Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8915281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:56:24+00:00 2026-06-15T04:56:24+00:00

I’m quite new to primefaces and i ran to this issue with p:draggable commponent.

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T04:56:26+00:00Added an answer on June 15, 2026 at 4:56 am

    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

    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<SomeObjects> data = new ArrayList<SomeObjects>();
    
    
    public void addItem(){
    data.add(new SomeObjects("someName"));
    }
    
    
    public List<SomeObjects> getData() {
        return data;
    }
    
    
    public void setData(List<SomeObjects> data) {
        this.data = data;
    }
    
    }
    

    SomeObject.java

    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;
    }
    
    }
    

    draggable.xhtml

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <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">
    <h:head>
    </h:head>
    <h:body>
        <p:separator styleClass="espacador" />
        <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" />
    <h:body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.