You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 29 Members of 4508 |
| Forum: Seam Users |
13. Mar 2008, 19:13 CET | Link |
Hi! I am trying to implement the CRUD page for an entity that will represent a tree: Category many to one Category Category one to many Category
Any hints on how could it be implemented?
I am thinking about using NestedConversations so that when CategoryHome calls CategoryHome it would actually be calling a CategoryHome in a nested Conversation
What do you guys think about it? Is it a good begining?
Another possibility could be adding a java.util.Stack to the CategoryHome and use it to keep track the previous definedInstances
Any hints?
Regards,
Hi! I am trying to understand the seam-generated applications. I seems that they work like this:
Now... I tought I could solve this problem by using nested conversations... but there is no conversation until after I click to add the child entity, therefore a nested conversation is not only not useful, it is plain wrong, because we don't even have a conversation.
Is the EntityHome/Entity.xml/EntityEdit.xml pattern as implemented in seam-gen usable for recursive relationships? I am really starting to think that the answer is no, because the EntityEdit.xml seams to be designed to always be called by Entity to edit the current instance, and never to create a new instance of the same type connected to the previously viewed instance...
Do I make any sense? Can anyone offer any hints at all?
Thanks, Francisco
Hi!
The problem seems to be that, when adding the chid entity instance over the recursive relationship, the of the parenty entity is it doesn't matter if the button has the parameter or not, it is propagated because it is in EntityEdit.page.xml... mmmm....
What if I delete that line... well then the normal non-recursive Edit button will stop working...
It seems that the EditEntity.xhml can only be used in the context of modifying a new entity and not in the context of adding a recursive child... and the pageflow defined just doesn't seem to allow any other use...
The problem here seems to be that I have 3 alternative page flows..:
IMO the problem is that 2 and 3 get mixed... I need to make the aplication that it was Viewing an Entity so that i can create a a new instance (as in 1) but at the same time it has to remember to that instance to the parent instance...
Any hints at all?
Regards,
Francisco
Not ootb. I would use an EntityHome to manage to the top level entity, and then write some extra code to manage the recursion.
Read about how to report a bug.
Hi!
The thing is I don't quite get how the org.jboss.seam.framework.EntityHome receives the primary key through the query string.
The query string key looks like this: entityNamePrimaryKeyName but I do not see any:
declared in org.jboss.seam.framework.EntityHome (of course it would be impossible since EntityHome is generic base clase inside the seam jar)
I have been trying to understand how this works to change it and add recursive behavior but I don't get it.. If I go up in the inheritance hierarchy I can see that code to handle primary keys is added at the org.jboss.seam.framework.Home, but I don't know how the private Object id gets the value from the entityNamePrimaryKeyName request parameter.
It uses an interceptor of some kind? how does it work? how can it know wich query string parameter is the one that contains the primary key?
Thanks
Regards,
Francisco
Hi!
The Entity Home of, for example Users, with a primary key with name IdUser will look like this:
public void setUserIdUser(Long id) { setId(id); } public Long getUserIdUser() { return (Long) getId(); }How does seam know it has to call this method? (It doesn't have a @RequestParameter anywhere!
Regards,
Francisco
Page parameters.
Read about how to report a bug.
Thanks, yes, you are right, the Page parameters, sorry for the silly question...
I got it to the point where it saves the recursive child and not a referece to itself, the problem now is that after saving the child, instead of going back to view the parent, it goes to view the recently added child...
hi, can you tell me how did you get it working using Page parameters? thanx