gwt tablayoutpanel - In GWT how do I handle the tab click event? -



gwt tablayoutpanel - In GWT how do I handle the tab click event? -

i have tab layout panel in ui.xml :

<g:tablayoutpanel ui:field="tabpanel" barheight='30'> <g:tab> <g:header size='7'>tab1</g:header> <g:simplepanel ui:field="tab1" height="100%"/> </g:tab> <g:tab> <g:header size='7'>tab2</g:header> <g:simplepanel ui:field="tab2" height="100%"/> </g:tab> </g:tablayoutpanel>

how handle event generated on clicking tab2?

handle selectionevent<integer> or beforeselectionevent<integer> depending on requirements.

e.g:

tabpanel.addselectionhandler(new selectionhandler<integer>() { @override public void onselection(selectionevent<integer> event) { if (event.getselecteditem() == 1) { // code } } });

or:

@uihandler("tabpanel") void ontabselection(selectionevent<integer> event) { if (event.getselecteditem() == 1) { // code } }

gwt gwt-tablayoutpanel

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -