I edited my question to be more precise as I have more time to write it.
I have a JSF form that should modify the value of the different properties of a dog :
<h:form id="submit">
<h:outputLabel value="Dog name:"/>
<h:inputText value="#{User.dog.name}" id="dogName"/>
<h:outputLabel value="Name :"/>
<h:inputSecret value="#{User.name}" id="name" />
<h:commandButton type="submit" value="Submit" />
</h:form>
This is my managed bean User.java
:
(All the getter and setter are good and valid, as this is a bean constructor is empty).
(Initially Dog property is initialized in a validation method, so it has a value and is not null
)
public class User {
public User() {}
String name;
Dog dog;
(...get, set, ect...)
This is an other bean that I have not set managed as it is only used by User class
Dog.java
:
public class Dog{
public User() {}
String dog_name;
(...)
Offcourse this is a simple exemple for understanding the thing.
When I send the form, User.name
property will update but not the User.dog.name
property.
How can both java classes values be updated ?
After the form is submitted I show the current values, only the User.name
has changed :
System.out.println(User.name); //value changed after form is submitted System.out.println(User.dog.name); //value NOT changed after form is submitted
I dont know if you understand my problem here, I want to manipulate the Dog class properties within my JSF form althouth I wont modify the Dog bean directly, only the User.Dog
...
By the way, faces-config is ok :
EDIT : I have added a for my User managed bean. Although, nothing is changed...
<managed-property>
<property-name>dog</property-name>
<property-class>package.Dog</property-class>
<value>#{Dog}</value>
</managed-property>