  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | - conversations join/nest | - conversations join/nest 2007-07-12 - By rapowder
Back Hi,
In my application (Seam 1.2.1GA) I use 2 level of nested conversations to navigate across categories, subcategories and items of each subcategory. That's my scenario:
Bean 1 (select a category) -> Root Conversation Bean 2 (select a subcategory) -> Nested inside the root Bean 3 (edit an item of the subcategory) -> Nested inside the previous
When I switch between categories the subcategories are updated, when I click on a subcategory I see the respective items, and when I click on an item I can edit its properties. In order not to create a new (or new nested) conversation each time I switch cat, subcat or item I have written this method (called in the @(protected) methods of my backing beans) to always join the correct level of conversation.
| public void joinSameOrNest(Class caller) { | Conversation current = Conversation.instance(); | boolean started = false; | for (ConversationEntry entry : ConversationEntries.instance() .getConversationEntries()) { | if(entry.getDescription().equals(caller.getName())) { | entry.select(); | log.info("Joining conversation " + caller.getName()); | current.begin(true, false); | started = true; | } | } | if(!started) { | log.info("Starting nested conversation " + caller.getName()); | current.beginNested(); | } | } |
I recognize the level of conversation since, in the @(protected) methods of my backing beans I first call the method:
| public void setDescription(Class caller) { | Conversation.instance().setDescription(caller.getName()); | } |
Until the first level of nesting it works fine and in the conversation stack I always see the root and the nested, but when I try to edit an item (starting the 2nd level of nesting) I get an exception:
java.lang.IllegalStateException : beginNested() called with no long-running conversation
Is it actually possible to have multiple nesting? Is something wrong in my method? I was using the annotations before @(protected)(nested/join), but a limited behaviour can be achieved with that. Or am I wrong?
Thanks for any suggestions! Cheers
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic &p=4063416#4063416
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode =reply&p=4063416 __ ____ ____ ____ ____ ____ ____ ____ ____ ____ jboss-user mailing list jboss-user@(protected) https://lists.jboss.org/mailman/listinfo/jboss-user
|
|
 |