1 2 3 Previous Next 34 Replies Latest reply on Apr 6, 2006 9:24 PM by Gavin King

    Problem using ADF Faces components with SEAM

    Peter Repinc Newbie

      Hello

      Currentlly we were developing an application using ADF Faces componets and SEAM beta 2 version. Everithing works fine. In application we use simple Page flow definition for some conversation cases.

      PROBLEM: When I tried to use newest nightly build of SEAM (20060401) Application stoped working. When I previously used <af:commandLink ...>
      tag it worked and did make advancement in page flow. Now it does not do anything. It behaves as i just returned NULL outcome. This must be SEAM problem because when I switched back jboss-seam.jar to the one distributed
      in jboss-seam-beta2 deployment package everithing work again as it should.

      What are your suggestion for wrong behavious

      Silvo Koren

        • 1. Re: Problem using ADF Faces components with SEAM
          Gavin King Master

          Well, you havn't shown any code at all, so it is not really possible to help...

          • 2. Re: Problem using ADF Faces components with SEAM
            Peter Repinc Newbie

            Hello

            Yes you are right. Now just imagine that there is a page where you could select the type of object to create.

            Here is the part of jsp that provides a link.

            <af:commandLink id="aPartner" text="#{msg.class_partner}" action="select">
             <f:param name="objectType" value="Partner" />
            </af:commandLink>


            This link has attached action "select". This action represends the transition name in page flow definition

            Here is pageflow definition

            <?xml version="1.0" encoding="UTF-8"?>
            
            <pageflow-definition name="newObject">
             <start-state name="start">
             <transition name="browse" to="selectClass"></transition>
             </start-state>
             <page name="selectClass" view-id="/selectClass.jsp" redirect="true" >
             <description>#{msg.title_selectClass}</description>
             <transition name="browse" to="selectClass"></transition>
             <transition name="cancel" to="mainAdministration"></transition>
             <transition name="select" to="editObject">
             <action expression="#{classSelection.selectClass}" />
             </transition>
             </page>
             <page name="editObject" view-id="/editObject.jsp" redirect="true">
             <description>#{msg.title_editObject} : #{objectType}</description>
             <event type="node-enter">
             <action expression="#{newObject.createObject}" />
             </event>
             <transition name="ok" to="mainAdministration">
             </transition>
             <transition name="cancel" to="mainAdministration">
             <action expression="#{newObject.removeObject}" />
             </transition>
             <transition name="back" to="selectClass">
             <action expression="#{newObject.removeObject}" />
             </transition>
             </page>
             <page name="mainAdministration" view-id="/mainAdministration.jsp" redirect="true">
             <end-conversation />
             </page>
            </pageflow-definition>


            In this pageflow definition I still use one particular transition from start to first page where there is exactly the same transition defined to itself as a workaround a bug which i thing is allready corrected in current nightly build, when you imediately traverse to first page.

            Here is java ClassSelection object which stores parameter

            @Name(ContextVariables.CLASS_SELECTION)
            @Scope(ScopeType.EVENT)
            public class ClassSelection {
             @In(create=true)
             private ObjectTypeMapper objectTypeMapper;
            
             @RequestParameter @Out(required=true,scope=ScopeType.CONVERSATION)
             private String objectType;
            
             @SuppressWarnings("unused")
             @Out(required=true,scope=ScopeType.CONVERSATION)
             private String objectClass;
            
             public void selectClass() {
             objectClass = objectTypeMapper.getObjectClass(objectType);
             }
            }


            Here is NewObject class which would create new object

            @Name(ContextVariables.NEW_OBJECT)
            @Scope(ScopeType.EVENT)
            public class NewObject {
             @SuppressWarnings("unused")
             @In
             private String objectClass;
            
             public void createObject() {
             }
            
             public void removeObject() {
             }
            }


            Currently no object is created yet.

            Now when I am in selectClass page select action should take me to the editObject page. On transition for select I invoke the action which takes parameter and store it for later usage. On entering the editObject I take this value and create new object of the type I specified and then provide this new object to edit page where I generically present properties to edit.
            At the end I can store or discard this created object.

            This is the scenario which worked before. Now something has been changed in the way how seam operates that this scenarion no longer works.


            Silvo Koren

            • 3. Re: Problem using ADF Faces components with SEAM
              Peter Repinc Newbie

              Correct page flow:

              <pageflow-definition name="newObject">
               <start-state name="start">
               <transition name="browse" to="selectClass"></transition>
               </start-state>
               <page name="selectClass" view-id="/selectClass.jsp" redirect="true" >
               <transition name="browse" to="selectClass"></transition>
               <transition name="cancel" to="mainAdministration"></transition>
               <transition name="select" to="editObject">
               <action expression="#{classSelection.selectClass}" />
               </transition>
               </page>
               <page name="editObject" view-id="/editObject.jsp" redirect="true">
               <event type="node-enter">
               <action expression="#{newObject.createObject}" />
               </event>
               <transition name="ok" to="mainAdministration">
               </transition>
               <transition name="cancel" to="mainAdministration">
               <action expression="#{newObject.removeObject}" />
               </transition>
               <transition name="back" to="selectClass">
               <action expression="#{newObject.removeObject}" />
               </transition>
               </page>
               <page name="mainAdministration" view-id="/mainAdministration.jsp" redirect="true">
               <end-conversation />
               </page>
              </pageflow-definition>


              • 4. Re: Problem using ADF Faces components with SEAM
                Peter Repinc Newbie

                I have problem submiting XML pageflow definition. It seems that portions of it are swallowed.

                Last try

                <pageflow-definition name="newObject">
                 <start-state name="start">
                 <transition name="browse" to="selectClass"></transition>
                 </start-state>
                 <page name="selectClass" view-id="/selectClass.jsp" redirect="true" >
                 <description>#{msg.title_selectClass}</description>
                 <transition name="browse" to="selectClass"></transition>
                 <transition name="cancel" to="mainAdministration"></transition>
                 <transition name="select" to="editObject">
                 <action expression="#{classSelection.selectClass}" />
                 </transition>
                 </page>
                 <page name="editObject" view-id="/editObject.jsp" redirect="true">
                 <description>#{msg.title_editObject} : #{objectType}</description>
                 <event type="node-enter">
                 <action expression="#{newObject.createObject}" />
                 </event>
                 <transition name="ok" to="mainAdministration">
                 </transition>
                 <transition name="cancel" to="mainAdministration">
                 <action expression="#{newObject.removeObject}" />
                 </transition>
                 <transition name="back" to="selectClass">
                 <action expression="#{newObject.removeObject}" />
                 </transition>
                 </page>
                 <page name="mainAdministration" view-id="/mainAdministration.jsp" redirect="true">
                 <end-conversation />
                 </page>
                </pageflow-definition>
                


                • 5. Re: Problem using ADF Faces components with SEAM
                  Gavin King Master

                  And what code begins the pageflow?

                  • 6. Re: Problem using ADF Faces components with SEAM
                    Peter Repinc Newbie

                    This MainAdministration class

                    @Name(ContextVariables.MAIN_ADMINISTRATION)
                    @Scope(ScopeType.CONVERSATION)
                    public class MainAdministration {
                     //@In(create=true) @Out
                    
                     @In
                     private Context conversationContext;
                    
                     @Begin(join=true,pageflow="openObject")
                     public String openObject() {
                     return NavigationOutcomes.BROWSE;
                     }
                    
                     @Begin(join=true,pageflow="newObject")
                     public String newObject() {
                     return NavigationOutcomes.BROWSE;
                     }
                    
                     public String exit() {
                     return NavigationOutcomes.EXIT;
                     }
                    }
                    


                    • 7. Re: Problem using ADF Faces components with SEAM
                      Peter Repinc Newbie

                      I am preaty new to SEAM framework but this is what i figured out from examples and documentation how to use pageflow in seam. I am also new to this forum so I had to figure out also how to post code :)

                      Silvo Koren

                      • 8. Re: Problem using ADF Faces components with SEAM
                        Gavin King Master

                        OK, so, you have join=true on the @Begin method.

                        What happens if you remove it?

                        • 9. Re: Problem using ADF Faces components with SEAM
                          Peter Repinc Newbie

                          Hello
                          One additional question. How I shoud configure soure code in eclipse that I am able to debug through SEAM code. I have downloaded jboss-seam code from CVS as anonymous when I run my web application breakpoints on Seam code does not work. My project does have link to seam project.

                          Silvo Koren

                          • 10. Re: Problem using ADF Faces components with SEAM
                            Peter Repinc Newbie

                            If I remove join=true behaviour is the same. Problem still occuring. I wanted to look (debug) through code of SEAM, but does not now how to setup seam code in eclipse to be able to do that.

                            • 11. Re: Problem using ADF Faces components with SEAM
                              Gavin King Master

                              hold on, you have pageflow="openObject", but in the pageflow-definition, the name is "newObject"...

                              And I also don't have any evidence that the openObject() method ever actually gets called (nothing in the code you have shown so far).

                              • 12. Re: Problem using ADF Faces components with SEAM
                                Peter Repinc Newbie

                                I showed the whole MainAdministration class. openObject() is just one method. There exist also newObject() method which uses proper newObject pageflow. In the application i have many pageflow definitions. There exist also openObject pageflow definition. In this example I just concentrated on newObject pageflow. OpenObject is exibiting same problem.

                                • 13. Re: Problem using ADF Faces components with SEAM
                                  Peter Repinc Newbie

                                  To clarify things. When I call those two methods "newObject" or "openObject", proper pageflow were initiated, because I did come to the first pages of both pageflows. In this example this is selectClass.jsp where lies diferent commands to invoke particular class. But this is when things stop working. Whwn I used old distribution of SEAM pageflow was properly propagated to the next page, but in this new distribution (nightlybuild) pageflow does not propagate anymore without any obvious reason.

                                  I tried to debug but must first setup correctly seam source code in eclipse so that breakpoints will work.

                                  Silvo Koren

                                  • 14. Re: Problem using ADF Faces components with SEAM
                                    Gavin King Master

                                    I'm really not sure I believe you. How could the "newObject" pageflow begin if you have:

                                    @Begin(join=true,pageflow="openObject")


                                    1 2 3 Previous Next