[jboss-user] [JBoss Seam] - Missing something basic with regards to bijection
mlh496
do-not-reply at jboss.com
Wed Apr 11 13:15:18 EDT 2007
Hey there,
Suppose you have a Stateful bean called "PersonManager" that handles both the CRUD and search features for the "Person" entity. I'm using Session scope. I have the following in the "PersonManager"
| @DataModel
| List<Person> people;
|
| @DataModelSelection
| Person selectedPerson;
|
| // Person property
| private Person person;
| public void setPerson(Person person) { this.person = person; }
| public Person getPerson() { return person; }
|
| public void clickPerson() {
| person = selectedPerson;
| return "edit";
| }
|
When I display a clickable data table with a command link to clickPerson, the selectedPerson does get injected into the PersonManager. I then assign this to the "person" property. Now if I go to a page to edit the Person, expressions like #{personManager.person.firstName} fails. HOWEVER, if I use an expression like #{personManager.selectedPerson.firstName} it works.
Why doesn't it stick when I copy the selectedPerson to the property?
-Michael
PS: I'm using the edit page to also create new people. This is why I wanted to bind the edit page to a property and not a selected item.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036455#4036455
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036455
More information about the jboss-user
mailing list