[Dojo-interest] How to detect which Tab is selected in theTabcontainer

Karl Tiedt ktiedt at gmail.com
Fri Feb 16 15:27:49 MST 2007


maybe this is more helpful... yourTabContainer.selectedChildWidget is a
reference to the contentPane child for the selected tab...

-Karl

On 2/16/07, Dean Parkinson <parkinsondean at hotmail.com> wrote:
>
> Ok - but how do you get the id of the currently shown page?  I tried
> looking
> at the selectedChild property but it never changed.
>
>
> >From: "Karl Tiedt" <ktiedt at gmail.com>
> >Reply-To: dojo-interest at dojotoolkit.org
> >To: dojo-interest at dojotoolkit.org
> >Subject: Re: [Dojo-interest] How to detect which Tab is selected in
> >theTabcontainer
> >Date: Fri, 16 Feb 2007 13:57:55 -0700
> >
> >    // selectedChild: String
> >    //   id of the currently shown page
> >
> >should make things rather simple....
> >
> >On 2/16/07, Dean Parkinson <parkinsondean at hotmail.com> wrote:
> >>
> >>Hai,
> >>
> >>Yeah - I dug back through the archives a couple weeks ago.  After much
> >>digging it turns out to be pretty straight forward.  In your
> >>mainTabContainer div attach a method like this:
> >>
> >>   <div id='mainTabContainer' dojoType="TabContainer"
> labelPosition="top"
> >>selectedChild="namesDiv" selectChild="doSomething();" >
> >>
> >>The selectChild names a routine that is called when a user clicks a
> >>tab.  To
> >>determine which tab is selected you can write some javascript like this:
> >>
> >>function doSomething() {
> >>         var firstDiv = dojo.widget.byId('firstDiv');
> >>         var secondDiv = dojo.widget.byId('secondDiv');
> >>         if (firstDiv.isShowing()) {
> >>                 // content of first div is visible
> >>         } else if (secondDiv.isShowing()) {
> >>                 // content of second div is visible
> >>         }
> >>}
> >>
> >>Perhaps there is something even more eloquent but this seems pretty
> good.
> >>Someone in the know should write some doc on this and put it into the
> >>wiki.
> >>
> >>Dean
> >>
> >> >From: hai_vu at Mitel.com
> >> >Reply-To: dojo-interest at dojotoolkit.org
> >> >To: dojo-interest at dojotoolkit.org
> >> >Subject: [Dojo-interest] How to detect which Tab is selected in the
> >> >Tabcontainer
> >> >Date: Fri, 16 Feb 2007 14:48:20 -0500
> >> >
> >> >Hi all I am interested in using the TabContainer to display a number
> of
> >> >dynamic pages (i.e. pages that are periodically refreshed with new
> data
> >> >from the server). In order to maximize efficiency, I only want the tab
> >> >pane that is visible to be refreshed. As such I am looking for the
> items
> >> >below:
> >> >
> >> >- A way to find out which tab is selected (poll)
> >> >         AND/OR
> >> >- Have the tab pane receiving an event something like
> >>onSelect/onDeselect
> >> >
> >> >Can anyone point me to the solution to this problem please.
> >> >
> >> >Thanks,
> >> >
> >> >Hai
> >>
> >>
> >> >_______________________________________________
> >> >Dojo FAQ: http://dojo.jot.com/FAQ
> >> >Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> >> >Dojo-interest at dojotoolkit.org
> >> >http://dojotoolkit.org/mailman/listinfo/dojo-interest
> >>
> >>_________________________________________________________________
> >>Find what you need at prices you'll love. Compare products and save at
> >>MSN(r)
> >>Shopping.
> >>
> >>
> http://shopping.msn.com/default/shp/?ptnrid=37,ptnrdata=24102&tcode=T001MSN20A0701
> >>
> >>_______________________________________________
> >>Dojo FAQ: http://dojo.jot.com/FAQ
> >>Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> >>Dojo-interest at dojotoolkit.org
> >>http://dojotoolkit.org/mailman/listinfo/dojo-interest
> >>
> >
> >
> >
> >--
> >-Karl Tiedt
>
>
> >_______________________________________________
> >Dojo FAQ: http://dojo.jot.com/FAQ
> >Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> >Dojo-interest at dojotoolkit.org
> >http://dojotoolkit.org/mailman/listinfo/dojo-interest
>
> _________________________________________________________________
> Refi Now: Rates near 39yr lows!  $430,000 Mortgage for $1,399/mo -
> Calculate
> new payment
>
> http://www.lowermybills.com/lre/index.jsp?sourceid=lmb-9632-17727&moid=7581
>
> _______________________________________________
> Dojo FAQ: http://dojo.jot.com/FAQ
> Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> Dojo-interest at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>



-- 
-Karl Tiedt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20070216/02b7ed9f/attachment.html


More information about the Dojo-interest mailing list