4 Replies Latest reply on Jan 18, 2011 5:16 AM by ilya_shaikovsky

    a4j commandLink issue

    jovincen

      Hi,

       

      I have a situation where I have 2 forms that display at the same time, both use A4j:include to build their content.

       

      I have command links in both of these wizards.

       

      If I submit & rerender the first form then the command links tend to no longer work on the second.

       

      After digging around for a few days it seems to me that the automatically generated ID's (I try not to specify element id's) are becoming out of sync with what is on the server. This means the links no longer work.

       

      This issue is fixed by specifying the id's explicitly. Or I am sure an a4j:jsFunction for each link would also fix the issue.

       

      Is this what is happening? When I submit the first form am I changing the servers state for form 2?

       

      Is there something else I am missing?

       

      Cheers,

      Jon

        • 1. a4j commandLink issue
          ilya40umov

          1) Please, define what JSF implementation, RF version, App server you are using. Are you using facelets?

          2) Plain JSF without facelets worked very bad when you didn't use IDs. But I think that it's still necessary to specify IDs in some situation even with facelets. Why are you avoiding custom IDs for commanLinks?

          • 2. a4j commandLink issue
            jovincen

            I'm running seam 2.2.1.CR2:

            1) I believe its faces 1.2? ("<faces-config version=1.2" taken from faces config). Rich Faces v.3.3.3.CR1. I am using facelets.

             

            Facelets comes by default with Seam, I've primarily been using it for layouts. I have started defining my own tags rathen then use ui:include to clean up the issues I've been having. Things start to go funny when multiple forms on a single page include the same template with different ui:param values. Anyway defining tags is a little cleaner imo.

             

            2) Am using facelets. I haven't been using IDs because they are automatically generated - which i thought was great. Turns out its the worst thing ever as although it appears to work it doesn't... maybe in simple situations.

             

            Now I specify IDs for everything that composes into link id's (commandLinks, forms, a4j:regions, a4j:includes).. just to be safe.

             

            Cheers,

            • 3. a4j commandLink issue
              ashutoshd

              I am also facing same problem as jovincen

              I also have 3 a4j:commandLink in my same page which will redirect to another page depending on the choice.

              When i click a a4j:commandLink it works but if i click another a4j:commandLink it does not work.

              can anyone tell me how to solve this problem or any other alternative for this .

              • 4. a4j commandLink issue
                ilya_shaikovsky

                please start separate thread with code snippets. Even if issue looks similar but suggestions for original case not works - better to show complete picture and look to case as separate.