9 Replies Latest reply on Jul 21, 2011 4:23 PM by geziefer

    Where has s:link gone?

    geziefer

      Hi,


      I just started with Seam 3, coming from Seam 2. When looking at Seam Faces, I was suprised to find only 2 tags there and missing for example the s:link I used before. Am I looking at the wrong spot or has s:link been replaced by another mechanism?


      Geziefer

        • 1. Re: Where has s:link gone?
          lightguard
          • 2. Re: Where has s:link gone?
            geziefer

            So, sorry for aksing that again, but the search I did upfront didn't point me to it.


            Nevertheless, you speak of being part of JSF 2 now in the provided link, but I don't see a hint for the asker what happened with s:link or by what it has been replaced in JSF2?

            • 3. Re: Where has s:link gone?
              lightguard

              s:link will not be in Seam Faces and you should use JSF2 h:link instead.

              • 4. Re: Where has s:link gone?
                hantsy

                But h:link does not include a action attribute...


                Why not provide s:link in 2.3?

                • 5. Re: Where has s:link gone?
                  geziefer

                  Jason,


                  thanks for your quick reply, but I still couldn't solve it. Maybe I should come up with a specific example:


                  I used to do something like this to cancel the input of form fields bound to a backend seam component by initializing them again:


                  <s:button value="Cancel" action="#{myHandler.init}" />



                  Now I'm looking for the exact same behaviour when using JSF 2 / WELD / (if necessary) Seam 3.
                  What I came up with so far is using the command button from Rich Faces 4:


                  <a4j:commandButton value="Cancel" action="#{myHandler.init}" bypassUpdates="true" />



                  But you spoke of h:link (and I guess h:button, respectively) - how would I specify the required behaviour there and why does it not include an action attribute?


                  Apart from that, if you can suggest a better method to cancel the user inputs on a form page, so that the displayed entities are not changed, I'll be happy.


                  Geziefer.

                  • 6. Re: Where has s:link gone?
                    lightguard

                    Alexander Rühl wrote on Jul 21, 2011 06:10:


                    Jason,

                    thanks for your quick reply, but I still couldn't solve it. Maybe I should come up with a specific example:

                    I used to do something like this to cancel the input of form fields bound to a backend seam component by initializing them again:

                    <s:button value="Cancel" action="#{myHandler.init}" />



                    Now I'm looking for the exact same behaviour when using JSF 2 / WELD / (if necessary) Seam 3.
                    What I came up with so far is using the command button from Rich Faces 4:

                    <a4j:commandButton value="Cancel" action="#{myHandler.init}" bypassUpdates="true" />



                    But you spoke of h:link (and I guess h:button, respectively) - how would I specify the required behaviour there and why does it not include an action attribute?

                    Apart from that, if you can suggest a better method to cancel the user inputs on a form page, so that the displayed entities are not changed, I'll be happy.

                    Geziefer.



                    As my colleague George Gastaldi mentioned on IRC, you could use the type attribute on a commandButton to just use a button. You could also skip the action and use an actionListener.

                    • 7. Re: Where has s:link gone?
                      lightguard

                      hantsy bai wrote on Jul 21, 2011 06:09:


                      But h:link does not include a action attribute...

                      Why not provide s:link in 2.3?


                      It will still exist in 2.3 as far as I know, but you'd have to discuss that on the Seam 3 forums. In Seam 3 you could use the ViewConfig in Seam Faces, you could also use events, page metadata, etc. There are multiple ways to do this.


                      A few links:



                      • 8. Re: Where has s:link gone?
                        bleathem

                        How about:


                        <h:commandButton value="Cancel" action="#{myHandler.init}" immediate="true" />



                        What is the above facelet snippet missing functionality-wise from what you are looking for?

                        • 9. Re: Where has s:link gone?
                          geziefer
                          I haven't tried it yet, but the documentation (http://download.oracle.com/docs/cd/E17802_01/j2ee/javaee/javaserverfaces/2.0/docs/pdldocs/facelets/index.html) does not talk about skipping the model update phase, doesn't it?