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 8288023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:11:33+00:00 2026-06-08T12:11:33+00:00

I want to create editable h:panelGrid . I created this ArrayList: public ArrayList<userdata> dataList

  • 0

I want to create editable h:panelGrid. I created this ArrayList:

public ArrayList<userdata> dataList = new ArrayList<>();

    public class userdata
    {

        int userid;
        int groupid;
        String specialnumber;
        String username;
        String passwd;
        Date datetochangepasswd;
        String address;
        String stateregion;
        String country;
        String userstatus;
        String telephone;
        Date dateuseradded;
        Date userexpiredate;
        Date dateuserlocked;
        String city;
        String email;
        String description;

        public userdata(int userid, int groupid, String specialnumber, String username, String passwd, Date datetochangepasswd,
                String address, String stateregion, String country, String userstatus, String telephone, Date dateuseradded,
                Date userexpiredate, Date dateuserlocked, String city, String email, String description)
        {

            this.userid = userid;
            this.groupid = groupid;
            this.specialnumber = specialnumber;
            this.username = username;
            this.passwd = passwd;
            this.datetochangepasswd = datetochangepasswd;
            this.address = address;
            this.stateregion = stateregion;
            this.country = country;
            this.userstatus = userstatus;
            this.telephone = telephone;
            this.dateuseradded = dateuseradded;
            this.userexpiredate = userexpiredate;
            this.dateuserlocked = dateuserlocked;
            this.city = city;
            this.email = email;
            this.description = description;
        }

        public String getAddress()
        {
            return address;
        }

        public void setAddress(String address)
        {
            this.address = address;
        }

        public String getCity()
        {
            return city;
        }

        public void setCity(String city)
        {
            this.city = city;
        }

        public String getCountry()
        {
            return country;
        }

        public void setCountry(String country)
        {
            this.country = country;
        }

        public Date getDatetochangepasswd()
        {
            return datetochangepasswd;
        }

        public void setDatetochangepasswd(Date datetochangepasswd)
        {
            this.datetochangepasswd = datetochangepasswd;
        }

        public Date getDateuseradded()
        {
            return dateuseradded;
        }

        public void setDateuseradded(Date dateuseradded)
        {
            this.dateuseradded = dateuseradded;
        }

        public Date getDateuserlocked()
        {
            return dateuserlocked;
        }

        public void setDateuserlocked(Date dateuserlocked)
        {
            this.dateuserlocked = dateuserlocked;
        }

        public String getDescription()
        {
            return description;
        }

        public void setDescription(String description)
        {
            this.description = description;
        }

        public String getEmail()
        {
            return email;
        }

        public void setEmail(String email)
        {
            this.email = email;
        }

        public int getGroupid()
        {
            return groupid;
        }

        public void setGroupid(int groupid)
        {
            this.groupid = groupid;
        }

        public String getPasswd()
        {
            return passwd;
        }

        public void setPasswd(String passwd)
        {
            this.passwd = passwd;
        }

        public String getSpecialnumber()
        {
            return specialnumber;
        }

        public void setSpecialnumber(String specialnumber)
        {
            this.specialnumber = specialnumber;
        }

        public String getStateregion()
        {
            return stateregion;
        }

        public void setStateregion(String stateregion)
        {
            this.stateregion = stateregion;
        }

        public String getTelephone()
        {
            return telephone;
        }

        public void setTelephone(String telephone)
        {
            this.telephone = telephone;
        }

        public Date getUserexpiredate()
        {
            return userexpiredate;
        }

        public void setUserexpiredate(Date userexpiredate)
        {
            this.userexpiredate = userexpiredate;
        }

        public int getUserid()
        {
            return userid;
        }

        public void setUserid(int userid)
        {
            this.userid = userid;
        }

        public String getUsername()
        {
            return username;
        }

        public void setUsername(String username)
        {
            this.username = username;
        }

        public String getUserstatus()
        {
            return userstatus;
        }

        public void setUserstatus(String userstatus)
        {
            this.userstatus = userstatus;
        }
    }


    // Getter for the data list
    public ArrayList<userdata> getuserdata(){

        return dataList;
    }

I want to display the data into h:panelGrid. Can you tell me how I can do this?

I want to create this editable table but with h:panelGrid. I suppose that it’s possible to use h:panelGrid instead h:dataTable?

Best wishes

  • 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-08T12:11:35+00:00Added an answer on June 8, 2026 at 12:11 pm

    While it may be actually possible to hack something with h:panelGrid, you probably would have to fiddle with a lot of unnecessary code in your MBs, just for creating and binding components.

    If you want a finer grained control for your HTML table, what you want to do is probably to use ui:repeat, something like this:

    <table>
        <ui:repeat var="elem" value="#{yourMB.yourDataList}">
            <tr>
                <td>#{elem.userid}</td>
                <td>
                   <h:outputText value="#{elem.name}" 
                        rendered="#{not elem.editable}" />
                   <h:inputText value="#{elem.name}" rendered="#{elem.editable}" />
                </td>
                <td>
                   <h:outputText value="#{elem.telephone}" 
                        rendered="#{not elem.editable}" />
                   <h:inputText value="#{elem.telephone}"
                                rendered="#{elem.editable}" />
                </td>
                <td>
                  <h:commandLink value="Edit" rendered="#{not elem.editable}"
                     action="#{yourMB.editAction(elem)}" />
                </td>
            </tr>
        </ui:repeat>
    </table>
    <h:commandButton value="Save Changes" action="#{yourMB.saveAction}" />
    

    For this to work you should have a backing bean looking like this:

    @ManagedBean
    @ViewScoped
    public class YourMB {
        private List<Elem> dataList;
    
        @PostConstruct
        public void init() {
            // initialize dataList here
        }
        public void editAction(Elem e) {
            e.setEditable(true);
        }
        public void saveAction() {
            // do your thing here to update in the database,
            // and then reset the editable property for all items:
            for (Elem e : dataList) {
                e.setEditable(false);
            }
        }
        // getters and setters...
    }
    

    Check out the tutorials available here, which teaches how to use ui:repeat and also presents other options for looping in JSF.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this model: public class ExchangeRate { [Key] public int ExchangeRateID { get;
i want create Dynamic Slideshow in Jquery i'm Write this code var ctx =
I want to create a new field (or two) in my table that is
I'm new to Python & Django. I want to allow users to create new
I want to create an 'editable' table in MVC, where each row will have
I want to create a graphical component in Delphi that is editable to some
I want to create a combobox with the following array: var operators = new
I want to create setup of my web application with editable web.config file content.
I want to create a bookmarklet that sets the page to be editable, that
i want create multiple search where statement $where_search is a multiple condition from post

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.