Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: Doubled requests in TabbedPane

Jeromy Evans - Blue Sky Minds

2007-08-14

Replies:

In response to your second question:

Sebastian Kolbe wrote:
> Another question:
> Is there an easy way to catch the event (something like 'onclick') when
> a different tab is selected?
>
>  
Yes :
a. at page init time, lookup the id of each tab widget
b. connect a handler "before" the "show" event generated by the widget

The following javascript will call the handle1 or handle2 function when
tab1 or tab2 is selected respectively.

function handler1(evt) {
  // do something
}
function handler2(evt) {
  // do something
}

function init() {
   var tab1Widget = dojo.widget.byId("tab1");
   var tab2Widget = dojo.widget.byId("tab2");

   dojo.event.connect("before", tab1Widget, "show", handler1);
   dojo.event.connect("before", tab2Widget, "show", handler2);
}

dojo.addOnLoad( init );



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.