That Is how you added the handler, I'm wondering where. If you are adding it in the constructor, onLoad(), ...
If you are adding it in onLoad or some function that is called multiple time, that will explain why it is firing multiple times. Add a print statement before the add and check the output. On Dec 28, 1:08 am, ALB-PSP-DV1 <[email protected]> wrote: > I'm adding the selection handler to the TabLayoutPanel. > > fareDisplayPanel.addSelectionHandler(new SelectionHandler<Integer>() > { } > > On Dec 28, 8:56 am, Patrick Tucker <[email protected]> wrote: > > > > > Where are you adding theSelectionHandler? > > > On Dec 27, 7:47 am, ALB-PSP-DV1 <[email protected]> wrote: > > > > Hi, > > > > I have aTabLayoutPanel with 3 tabs. I have added a selection handler > > > to it to change the color of the selected/unselected tabs. > > > > However theselectionHandlerseems to beinvoked3timesinstead of > > > once when I select a tab. > > > > i.e.SelectionHandlerinvocation = Total number of tabs in > > >TabLayoutPanel > > > > @UiField > > >TabLayoutPanelfareDisplayPanel; > > > > fareDisplayPanel.addSelectionHandler(newSelectionHandler<Integer>() { > > > @Override > > > public void onSelection(final SelectionEvent<Integer> event) > > > { > > > ---------- code for styling selected/unselected > > > tabs---------- > > > } > > > > }); > > > > Can someone please point out the mistake that I'm doing. Thanks in > > > advance. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
