-
1. Re: EntityHome setId problem
dustismo Feb 22, 2007 6:03 PM (in response to dustismo)I still haven't figured this problem out.. Can anybody help?
thanks
Dustin -
2. Re: EntityHome setId problem
gavin.king Feb 22, 2007 6:30 PM (in response to dustismo)What initializes the page parameter in the first place? ie. how do you pass the parameter into that page?
-
3. Re: EntityHome setId problem
bulloncito Feb 22, 2007 7:11 PM (in response to dustismo)What do you mean by initializing the parameter in the first place ? isn't that what the page parameter does ?
I'm a seam newbie having a similar problem, if I select an entity from a h:dataTable using<s:link id="editUser" action="#{userSearch.editUser(user)}" propagation="join" >Edit</s:link>
then display the create/update form, it displays creation form, if I manually set in the url the " userId " parameter then it shows the update form, even if I leave page, and come back again using conversation begin, it still shows update page with old selected entity, until I hit update or delete, I also have<page> <restrict>#{identity.loggedIn}</restrict> <param name="userId" value="#{userHome.id}" converterId="javax.faces.Long" /> <begin-conversation join="true" /> <navigation from-action="#{userHome.persist}"> <end-conversation /> <redirect view-id="/registered.xhtml"> <param name="userId" value="#{userHome.id}" /> </redirect> </navigation> <navigation from-action="#{userHome.update}"> <end-conversation /> <redirect view-id="/registered.xhtml"> <param name="userId" value="#{userHome.id}" converterId="javax.faces.Long" /> </redirect> </navigation> </page>
... if I select one entity on the dataTable, and the form displays creation form, with already filled in fields of selected entity, and press create, it throws lots of exceptions of null values for not-null fields wich are not handled by seam, warning me not to have two phase listeners, wich I don't. We kind of need some further examples on documentation about using Home objects, that would be nice, they seem to rule, if they work of course.
I'm guessing we have similar problems propagating id's to home objects, if page parameters in pages.xml does not do this, then where do we have to ?
A Seam Newbie wandering for enlightenment. -
4. Re: EntityHome setId problem
gavin.king Feb 22, 2007 7:14 PM (in response to dustismo)Does editUser() call setId()?
It needs to. -
5. Re: EntityHome setId problem
gavin.king Feb 22, 2007 7:18 PM (in response to dustismo)BTW, I recommend starting from examples/contactlist or seam generate-entities.
-
6. Re: EntityHome setId problem
dustismo Feb 22, 2007 8:28 PM (in response to dustismo)I am passing the id in as a get parameter.. i.e.
http://localhost:8080/webapp/clients/admin_group.seam?groupId=1
I have looked at the contactlist example, and it doesn't really help (I need to have an actual EntityHome class, and ./seam generate-entities hasn't worked for me since 1.1.1 (I posted about it awhile ago and never figured out the problem)..
Thanks for any help,
Dustin -
7. Re: EntityHome setId problem
bulloncito Feb 22, 2007 9:05 PM (in response to dustismo)Thanks for the quick response, I'm using declarative approach:
<factory name="user" value="#{userHome.instance}"/> <framework:entity-home name="userHome" entity-class="bco.time.ejb3.User" entity-manager="#{entityManager}" />
I actually prefered to use extension but that was not working, so I used the seampay homeobjects as example, I tried using seamgen to find any differences, but the best for me was extending hotel booking example. Where should I call setId() ? on userHome ? I'm lost again. Should I inject userHome to call setId on it ? I'll try using extension then.