-
1. Re: Design Question and Seam/JSF question
jkrupka Aug 16, 2006 12:08 PM (in response to jkrupka)Something else I just noticed, on the request that seems to go to the wrong page, the following line gets printed to the console:
"[HtmlRendererUtils] There should always be a submitted value for an input if it is rendered, its form is submitted, and it is not disabled or read-only."
Not sure if this has anything to do with it or not..
Here's part of the code for the seam component, the Editor for what would be table B in the hierarchy:@Name("eTStatusEditor") @Stateful @Interceptors(SeamInterceptor.class) public class ETStatusEditorBean implements ETStatusEditor { @In(create = true) private EntityManager entityManager; @Valid private ETStatus instance = new ETStatus(); @TransactionAttribute(NOT_SUPPORTED) @Out(scope=ScopeType.CONVERSATION, required = false, value="parentEtStatus") public ETStatus getInstance() { initStatus(); return instance; } @TransactionAttribute(NOT_SUPPORTED) @Begin(join=true) private void initStatus() { if (parentEtMaster != null) { instance.getId().setPartkey(parentEtMaster.getPartkey()); isChild = true; } else { isChild = false; } } public void setInstance(ETStatus instance) { this.instance = instance; } @Out(required = false, scope=ScopeType.CONVERSATION) @In(required = false, value="parentEtMaster", scope=ScopeType.CONVERSATION) private ETMaster parentEtMaster; @TransactionAttribute(NOT_SUPPORTED) public ETMaster getParentEtMaster() { return parentEtMaster; } public void setParentEtMaster(ETMaster eTMaster) { this.parentEtMaster = eTMaster; } private boolean isNew = true; @TransactionAttribute(NOT_SUPPORTED) public boolean isNew() { return isNew; } public void setNew(boolean isNew) { this.isNew = isNew; } private boolean isChild = true; @TransactionAttribute(NOT_SUPPORTED) public boolean isChild() { return isChild; } public void setChild(boolean isChild) { this.isChild = isChild; } private String doneOutcome = "find"; public void setDoneOutcome(String outcome) { doneOutcome = outcome; } private String doneChildOutcome = "doneChild"; public void setDoneChildOutcome(String outcome) { doneChildOutcome = outcome; } ... /*this is the action method that gets called the first time the button is hit, but seems to get skipped the second time it's hit...*/ public String updateAndCreateChild() { refreshFinder(); return "child"; } ....
Thanks again, I'm running out of ideas on this one... -
2. Re: Design Question and Seam/JSF question
jkrupka Aug 16, 2006 5:33 PM (in response to jkrupka)I'm really stuck on this. I keep coming back to the fact that the only reason I know its not working is that my action function is not being called when I hit the button that calls it.. I know it works the first time I hit it, but not the second time.
Is there any other debugging I can do? Can I get the seam-debug page working that is in the booking example? Or should I try going through the Seam src code?
Please help.... -
3. Re: Design Question and Seam/JSF question
jkrupka Aug 17, 2006 12:06 PM (in response to jkrupka)Ah ha! I figured out the problem. When I finished doing whatever with Table C, I was ending the conversation. So I think I misunderstood how conversations work. I thought that when I was going back and forth from forms I was switching conversations, that it switched when I want to the new page/Seam component. But i guess what actually was happening was I was in a conversation from A to B to C, and that if I actually wanted to switch I would have had to use the switcher object...
Am I correct here?
So what would be the better approach here, to have one conversation from A to B to C, or seperate conversations for each and use switcher to jump btwn then?
Thanks from a newbie.. -
4. Re: Design Question and Seam/JSF question
bfo81 Aug 17, 2006 1:45 PM (in response to jkrupka)If I understood correctly that A, B and C are nested, then the comversations should be nested, too.
As an example (I'm not sure if this is what you have), let's look at a quiz (who wants to be a millonaire *g*).
I have an Entity class Question and an Entity class Answer.
Question 1:n Answer
So every question has multiple answers, and every answer belong to exactly one question.
Now if I edit a question I begin a new conversation. That means I can edit multiple questions in multiple windows, and every edit process runs in its own conversation.
And during editing a question, I can edit its answers (or add some), each in a new window, with its own NESTED "sub-"conversation.
To begin a nested conversation just use @Begin(nested=true).
If I misunderstood your scenario... sorry ;). -
5. Re: Design Question and Seam/JSF question
jkrupka Aug 17, 2006 1:57 PM (in response to jkrupka)Ah ok I hadn't thought of using nested conversations. Could I still jump in and edit say table B or C without going through A?
Thanks. -
6. Re: Design Question and Seam/JSF question
bfo81 Aug 17, 2006 4:20 PM (in response to jkrupka)You can start nested conversations even without having a parent conversation. It's just like a normal top-level conversation then.