i have created a gwt application in which i need to display a series of jsp pages. the jsp pages are present inside a gwt frame which itself is present within a Tabpanel. Now i need to close the tab panel automatically as soon as the user enters the value in any jsp page and submit it. Can anyone suggest me any possible solution as to how i can access(get reference) the tab panel from the jsp page in order to close it.
A:
Using javascript. Execute this line of javascript anywhere in your JSP page.
parent.someGlobalFunction();
Zoidberg
2010-04-12 11:16:29
+1
A:
My approach would be something like:
Create a native function that closes the appropriate tab. You might try closing the tab based on its name, maybe id or maybe some other criteria - this is up to you. Then from the JSP page, when you want to close that tab, make a call to the native function.
This is what you GWT code might look like:
protected native JavaScriptObject createCloseTabJsFunction() /*-{
$wnd.closeTab = function() {
//TODO: your logic for closing the tab
}
}-*/;
Then somewhere in your JSP page make a call to closeTab() Maybe something like
window.parrent.closeTab();
Hope this helps you....
markovuksanovic
2010-04-12 12:01:38