How to get value from Java object

Posted by JSF User on Stack Overflow See other posts from Stack Overflow or by JSF User
Published on 2012-12-11T22:45:03Z Indexed on 2012/12/11 23:03 UTC
Read the original article Hit count: 134

Filed under:
|
|

I have this Java object

private List<NewAccountObj> dataList;

    public class NewAccountObj {

            private int userid;

            public NewAccountObj(int userid) {

                this.userid = userid;


            }

            public int getUserid() {
                return userid;
            }

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

    public List<NewAccountObj> getdataList() {        
            return dataList;
        }

What is the proper way to access a value from the object? Is this correct?

<h:inputText id="userid" value="#{NewAccountController.dataList.userid}" 
             validator="#{ValidatorAccountController.validateUserID}" autocomplete="off">                                        
    <f:ajax event="blur" render="useridvalidator" />                                          
</h:inputText>

Is there any other solution?

© Stack Overflow or respective owner

Related posts about java

Related posts about jsf