i did it.. it is called by himself.. 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 <[email protected]> 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 <[email protected]> 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 <[email protected]>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 [email protected]. >>>>> To post to this group, send email to [email protected]. >>>>> >>>>> Visit this group at http://groups.google.com/group/google-web-toolkit. >>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>> >>>> >>>> -- >>> 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 [email protected]. >>> To post to this group, send email to [email protected]. >>> 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 [email protected]. > To post to this group, send email to [email protected]. > 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
