1 2 Previous Next 17 Replies Latest reply on Jul 19, 2009 2:15 PM by Ronald van Kuijk

    ajaxSubmitSelection="false" not working and dblClick invokes

    Praveen Kumar Newbie

      Hi,

      I have written a custom view handler, which extends the FaceletViewHandler. Now I am trying to create a tree at runtime. I have not written any jsp page for this. I am trying to build a rich:tree using the code, dynamically.

      The problem that I am facing is that, I have set the ajaxSubmitSelection as false. Even then, when I click on the tree node, it invokes the nodeSelectionListener. I have downloaded the richfaces demo, it works fine there. But with my code, the nodeSelectionListener even after setting the ajaxSubmitSelection as false.

      The other problem is that, when i double click (this double click is attached as an a4jsupport)on any of the nodes, the nodeSelectionListener is invoked twice. This problem is giving me a nightmare as I don't have any clue where to fix this.

      This is really urgent. Any help on this will be highly appreciated.
      Thanks in Advance
      Praveen

      (My Environment: JSF1.2.09 and Richfaces 3.3.0 with Jdk1.5.10)

        • 1. Re: ajaxSubmitSelection=
          Ilya Shaikovsky Master

          Could not say much using description. ondblclick invokes nodeSelectionList two times because onclick as you mentioned before also submits selection. So two requests risen.

          • 2. Re: ajaxSubmitSelection=
            Ronald van Kuijk Master

            I have this 'problem' to. Would be nice if a double-click fires the selection only once. And in addition, I'd like a right-click to also fire selection once which it currently does not. That behaviour is in line with what you expect from desktop apps.

            Maybe I'll file a jira issue

            • 3. Re: ajaxSubmitSelection=
              Praveen Kumar Newbie

              Hi Ronald,

              Have you raised the JIRA issue. Please let me know, if you have already done that. I will really appreciate if you can give me the JIRA Id, so that I can also track the progress.

              Thanks is advance.


              Hi ilya,

              I really appreciate your comments, but I believe that on doubleClick, if the nodeSelectListener is getting invoked twice, it should not be attached to ajaxSubitSelection. I am not very much aware of it. Anyways, I need both the events for the tree, so ajaxSubmitSelection="false" is not the solution.

              Problem#1: ajaxSubmitSelection when set to false should not invoke the nodeSelectionListener.
              If you can throw some light on this issue as in how should i get it working, i will really appreciate that.

              I am using richfaces 3.3.0 with jsf1.2.09 on Tomcat 6.0.14.

              I have written my custom view handler and I am facing this issue for rich:tree. This tree is being created dynamically using the class as code show below:
              public void create() {
              tree = new HtmlTree();
              tree.setId(getControlId());
              tree.setVar(getControlId() + "Var");
              tree.setAjaxSubmitSelection(false);
              uiComponent = tree;
              }

              Similarly the tree nodes are created.

              Even after setting the ajaxSubmitSelection=false, the nodeSelectListener is getting invoked.

              Problem#2: Double click invokes nodeSelectListener twice.
              I am using richfaces 3.3.0 with jsf1.2.09 on Tomcat 6.0.14.

              I am not sure, where is the issue. Please guide me through that as well.

              Thanks in Advace.

              Praveen

              • 4. Re: ajaxSubmitSelection=
                Nick Belaevski Master

                Hi Praveen,

                Problem#1: ajaxSubmitSelection when set to false should not invoke the nodeSelectionListener.

                That's not right. ajaxSubmitSelection only controls client-side behavior - do ajax request or not. If form is submitted by another means and selection was changed, listeners will fire.

                Problem#2: Double click invokes nodeSelectListener twice.

                Make sure there are no two parallel requests in this case.

                • 5. Re: ajaxSubmitSelection=
                  Ronald van Kuijk Master

                  #2: Does a generic 'queue' help here? If so, that would be great, but still I think it should be default behaviour. A double click is something different then two quick single clicks and only should fire one event

                  I'll try tonight.

                  • 6. Re: ajaxSubmitSelection=
                    Ilya Shaikovsky Master

                     


                    #2: Does a generic 'queue' help here? If so, that would be great, but still I think it should be default behaviour. A double click is something different then two quick single clicks and only should fire one event

                    I'll try tonight.


                    good point but... try just to define some custom JS method in onclick and ondblclick at the same time on simple button and check the result. It's not RF specific at all.

                    • 7. Re: ajaxSubmitSelection=
                      Praveen Kumar Newbie

                      Hi nbelaevski,

                      I really appreciate your comments about ajaxSubmitSelection, but this is something which I have observed from the Richfaces demo. When I had ajaxSubmitSelection=false, the nodeSelectionListener was not invoked, but as soon as I set ajaxSubmitSelection to true, nodeSelectionListener was invoked properly. Please throw some light on this.

                      And for the problem #2, yes there are two parallel requests coming up and that is what I am trying to figure out, why are there two parallel request. Please let me know, what approach should I take to resolve this problem.

                      Thanks in Advance,
                      Praveen

                      • 8. Re: ajaxSubmitSelection=
                        Ilya Shaikovsky Master

                        Again on problem 1#.. When you explored at demo environment you probably just set it to false and clicked over the tree and no request occurs. But Nick told you that the server side event will be risen in this case on any external submit (e.g. from support as in your case). So this property manage only sending request internally.

                        • 9. Re: ajaxSubmitSelection=
                          Praveen Kumar Newbie

                          Hi ilya,

                          I got this point, but this is only in the demo environment. In my environment, where I have written my own custom view handler, the ajaxSubmitSelection=false still fires the server side event.

                          Please let me know, if you want to have a look at the code of custom view handler.


                          Thanks,
                          Praveen

                          • 10. Re: ajaxSubmitSelection=
                            Ronald van Kuijk Master

                             

                            "praveenkr09" wrote:
                            And for the problem #2, yes there are two parallel requests coming up and that is what I am trying to figure out, why are there two parallel request. Please let me know, what approach should I take to resolve this problem.


                            Because that is how javascript works.

                            http://www.chipchapin.com/WebTools/JavaScript/example3-01.html

                            The way he solved it is by using a 'timer' just like what the ajaxqueue does.

                            • 11. Re: ajaxSubmitSelection=
                              Ronald van Kuijk Master

                              Oh and in this regard (kind of topic hacking I know, sorry ;-)) is it possible to have the selectionchange also fire before the context menu event? So I can have a context menu content based on the item that is selected without having to select it first with a left click?

                              • 12. Re: ajaxSubmitSelection=
                                Ilya Shaikovsky Master

                                possible to have a4j:support for menu population and show the menu on oncomplete after rerendered

                                • 13. Re: ajaxSubmitSelection=
                                  Ronald van Kuijk Master

                                  Yes, that is how it works now (onContext event does not work in exendeddatatable) but before that how can I trigger the select? I'll make a new topic for this and try to make a small example which does not fully work. Maybe you can give some tips then based on that example. Thanks...

                                  • 14. Re: ajaxSubmitSelection=
                                    Praveen Kumar Newbie

                                    Hi Ronald,

                                    As per this link, double click will get a click event before you get double click event. But in my case, I am getting two click events before I get a double click event.

                                    I am using IE7.

                                    Please let me know, what approach should I take. Is ajaxQueue the only solution??

                                    Thanks in advance,
                                    Praveen

                                    1 2 Previous Next