2 Replies Latest reply on Nov 28, 2012 7:27 AM by Anton Ilyin

    How can i simulate click on richfaces tree node?

    Anton Ilyin Newbie

      Hello.

      I write tests on Telerik WebAii and it cant click on root node with native events.

      Please help me how i can do it. Maybe with JS? or smth else?

        • 1. Re: How can i simulate click on richfaces tree node?
          iabughosh Master

          welcome to the communtiy Anton,

          you can make treeNode performs an action :

          ...

          <rich:treeNode onclick="performAction()"/>

          ...

           

          <a4j:jsFunction name="performAction" action="#{yourBean.doAnAction}"/>

           

          regards.

          • 2. Re: How can i simulate click on richfaces tree node?
            Anton Ilyin Newbie

            Thanks Ibrahim,

            I found solution few minutes ago

             

             

            var $el = $(selector);

             

            var offset = $el.offset();

             

            var event = $.extend( $.Event( "mousedown" ), {

             

                                                            which: 1,

             

                                                            pageX: offset.left,

             

                                                            pageY: offset.top

             

                                                    });

             

            $el.trigger(event);