public class MyBean {
private Integer [] myField;
public Integer [] getMyField() {
return myField;
}
public void setMyField(Integer [] myField) {
this.myField = myField;
}
And I initialize this same bean in faces-config.xml in this way
<managed-bean-name>myBean</managed-bean-name>
<managed-bean-class>com.path.bean.MyBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>myField</property-name>
<list-entries>
<value>6</value>
<value>12</value>
<value>24</value>
</list-entries>
</managed-property>
</managed-bean>
Then, in the application I want to change these values. To do it:
MyBean myBean = new MyBean();
Integer [] results = myBean.getMyfield();
//Change the value of this array
visualizationBean.setResultsPerPage(results);
But this is not possible, Integer [] results = myBean.getMyfield()
gives me a null
. Anyway, in the interface of my application, I can see that the bean is correctly initialize, because it holds the values 6, 12 and 24.
Any kind of help??
Thanks in advance