Friday, March 7, 2014

Re: clickHandler goes in loop



On Friday, March 7, 2014 12:00:22 PM UTC+1, Davide Micheletti wrote:
i did it.. it is called by himself..

Sure, but when? and how many times?
 
i follow all the process step by step and at the end of the clickHandler it goes in dispatchEvent(event, handler) of SimpleEventBuss.class and it returns to the onClick of my project.. What can i do?
 

On Fri, Mar 7, 2014 at 11:14 AM, Thomas Broyer <t.br...@gmail.com> wrote:
I honestly have no idea, given the code snippets you showed. But put a breakpoint on your addClickHandler and see when it's being called, and where it's called from (look at the call stack in your IDE)


On Friday, March 7, 2014 11:06:03 AM UTC+1, Davide Micheletti wrote:
i don't understand your answer.. how can i call an addClick handler of a table in 2 different tab?


On Fri, Mar 7, 2014 at 11:01 AM, Thomas Broyer <t.br...@gmail.com> wrote:
I suspect you're calling addClickHandler each time you switch tab. Just try to do it once only.


On Friday, March 7, 2014 9:11:40 AM UTC+1, Davide Micheletti wrote:
its a long code, however in summary:
in tab1 i've a table (table1) with a clickHandler that depends from another table (table2)
in tab2 i've only display some db data

code when i switch tab

if (tabLayoutPanel.getSelectedIndex() == 0) { // tab1
build_tab1();
clear_TAB2();
tabLayoutPanel.setSize("100%", "1245px");

}else if (tabLayoutPanel.getSelectedIndex() == 1) { // tab2
build_tab2();
clear_TAB1();
tabLayoutPanel.setSize("100%", "1245px");
}



code tab1

table1.addClickHandler(new ClickHandler() {

public void onClick(ClickEvent event) {
               
              bool t = Window.confirm("continue?")

              if(t && is a radioButton in table2 checked??)
                        server call for db data
                        table1.settext(r,c,"something i need");
             else
                       Window.alert("select something in table2");
        }
});


now the problem is that if i change tab and i return in tab 1 the code in onClick() is runned n time where n is the number of times that i switched tab


On Thu, Mar 6, 2014 at 6:46 PM, Thomas Broyer <t.br...@gmail.com> wrote:
Show your code?


On Thursday, March 6, 2014 6:22:01 PM UTC+1, Davide Micheletti wrote:
Hi all, i've a tabLayoutPanel and in every tab there is a widget with a click Handler.. If i switch tab and i click on the widget with click Handler the code is runned 2 time for every switched tab.. Where i fail?? thanks..

Davide

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment