I tested this source code:
Bean:
private NewAccountObj na;
public class NewAccountObj {
private int userid;
............
public NewAccountObj(int userid.............) {
this.userid = userid;
............
}
public int getUserid() {
return userid;
}
...............
}
// Getters
public NewAccountObj getDataList() {
return na;
}
JSF Page:
<h:panelGrid columns="2">
<h:panelGroup>User ID</h:panelGroup>
<h:panelGroup>
<h:inputText id="userid" value="#{bean.dataList['userid']}">
</h:inputText>
</h:panelGroup>
......................
</h:panelGrid>
When I submit the form I get Target Unreachable, 'null' returned null
.
Can you help me to find the problem? Maye this is not the proper way to access Java object in h:panelGrid
?
PS:
I get this error message in Glassfish log:
javax.el.PropertyNotFoundException: /NewAccount.xhtml @38,126 value="#{NewAccountController.dataList['userid']}": Target Unreachable, 'null' returned null