14 Replies Latest reply on Oct 1, 2008 4:53 PM by pmuir

    Stop parameter propagation.

      Hi!
      All I want is to jump from an already started transaction into a new transaction. And I almost succeed, but now, it turns out some information from the old transaction is leaking into the  new transaction! (Note the propagation="none")


      <s:link propagation="none" action="#{someController.someAction}" value="{someController.someName}">
      </s:link>  
      



      Well, even with propagation="none" page parameters defined in the .page.xml are being propagated to the new conversation! How can I stop them from propagating?


      I even tried with combining h:commandLink/a4j:commandLink with s:conversationPropagation instead of s:link but s:conversationPropagation also propagates the page parameters!. I also tried with a plain h:commandLink/a4j:commandLink but then it does not stop conversation propagation.


      I need a way to specify propagation="none" and page-parameter-propagation="off". Is there a way?  I am starting to think that an h:outputLink may be the only answer but the problem is h:outputLink doesn't support calling actions.

        • 1. Re: Stop parameter propagation.
          admin.admin.email.tld

          you could use h:outputLink with a4j:support to call actions...

          • 2. Re: Stop parameter propagation.

            Now that is an strange combination... to what event in h:outputLink do you suggest I bind the a4j:support? I don't think this will work... could you elaborate on your suggestion?

            • 3. Re: Stop parameter propagation.
              admin.admin.email.tld

              event="onclick"

              • 4. Re: Stop parameter propagation.
                sjmenden

                I replied in the other post so just for completeness here it is again:


                To stop parameter propagation you need to include the param like so:



                <h:commandButton ... >
                   <f:param name="param1" />
                   <f:param name="param2" />
                </h:commandButton>




                ie, there is no great way currently to disable parameter propagation, so you have to define it without a value like above.

                • 5. Re: Stop parameter propagation.

                  Wouldn't that call action before the url of the outputLink is actually accessed?

                  • 6. Re: Stop parameter propagation.

                    I was going to reply you there,but thanks for posting it here.


                    Thats kind of a... how could I put it politely... mmmm... really ugly solution?


                    There should be a page-parameter-propagation="off" option in s:conversationPropagation... don't you think?


                    I would do it myself but I have no experience creating JSF tags...


                    This might be too much to ask for, but, can you provide me with some guidance on which files from seam source code should I copy to separate project in order to create my own enhanced  s:conversationPropagation?


                    Or is there some way to alter the html code some (but not all) s:links it produce? perhaps with a renderer?


                    • 7. Re: Stop parameter propagation.

                      It is also not a solution for a menu, because the menu may call different pages with some shared parameters, and some very different ones, and I may need to clear different parameters depending on from which page to which page I am going. Therefore I need a way to plain stop page parameter propagation.

                      • 8. Re: Stop parameter propagation.
                        sjmenden

                        Yeah it's not pretty, create a JIRA for something like page-parameter-propagation="false" and vote for it.  Not sure where to point you to in the source, you'll have to do some extended digging unless Pete can chime in.

                        • 9. Re: Stop parameter propagation.

                          It seems that this problem has alredy been discussed a long time ago (Nov/2007) in the old forum, and a JIRA JBSEAM-2310 has already been filed.


                          Of course, it is not as specific as the one I might file asking for a page-parameter-propagation="false" but it was filed because back then Pete Muir posted that: There probably needs to be a way of removing parameters from links. File a feature request in JIRA.


                          Mmmmm, I am not sure if I should file my own JIRA...

                          • 10. Re: Stop parameter propagation.

                            I decided that I will just add a comment to JBSEAM-2310 saying that it could be implemented by: adding a page-parameter-propagation="false" attribute to s:link and s:conversationPropagation to stop page parameter propagation


                            Please, if you need a new conversation each time an option in your menu, please vote for JBSEAM-2310.

                            • 11. Re: Stop parameter propagation.

                              In org.jboss.seam.ui.component.UISeamCommandBase in the method public String getUrl() throws UnsupportedEncodingException in this fragment:


                                    if (viewId != null)
                                    {
                                       Map<String, Object> pageParameters = Pages.instance().getStringValuesFromModel(context, viewId, usedParameters);
                                       for (Map.Entry<String, Object> me : pageParameters.entrySet())
                                       {
                                          UIParameter uip = new UIParameter();
                                          uip.setName(me.getKey());
                                          uip.setValue(me.getValue());
                                          url.addParameter(uip);
                                       }
                                    }
                              



                              I think that is the code that I need to wrap inside an if and only let it execute if page-parameter-propagation="true" but I need more guidance on how to achieve that.

                              • 12. Re: Stop parameter propagation.
                                terryb

                                Thanks for voting on the issue; I've been waiting on it for a long time. I guess may need to request for mass voting.


                                I also think PARAM tag in .page.xml should support if attribute. I have filed JIRA for this one too, please vote https://jira.jboss.org/jira/browse/JBSEAM-3483.


                                And, I would also be really useful if f:param used in xhtml etc supports rendered attribute; because s:fragment can not be used within some/many tags which do accept f:param. Anyone knows where to lodge request for enhancements to f:param?

                                • 13. Re: Stop parameter propagation.

                                  I agree with you two this would be very useful. I´ve voted for
                                  JBSEAM-3483 as well as for JBSEAM-2310.Hope a mass voting to happen!

                                  • 14. Re: Stop parameter propagation.
                                    pmuir

                                    Attach patches, and we can review and apply, I'm happy about the concepts.