This is a migrated thread and some comments may be shown as answers.

tab.get_pageView() returns null

5 Answers 152 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Ram
Top achievements
Rank 1
Ram asked on 21 Jul 2010, 07:50 PM

 

Hi,
I am trying to select tab from client-side javascript and select a corresponding view. Below is my code.. tab.get_pageView() returns null and I am not sure why. If I manually clicked on each tab corresponding pageView shows just fine, so my pageView exists.. What am I doing wrong? Is there better way of doing this?
Thanks!!
Kate

var
tabStrip = $find("<%= rtsAllOtherTabs.ClientID %>");

 

 

 

var tab = tabStrip.findTabByValue("User");

 

 

if (!tab)

 

{

alert(

"There is no tab with text \"" + text + "\"");

 

 

return false;

 

}

 

tab.select();

//works til this line

 

 

var pv = tab.get_pageView(); // now pv is null

 

pv.set_selected(

true);

 

 

return false;

 

5 Answers, 1 is accepted

Sort by
0
Ram
Top achievements
Rank 1
answered on 22 Jul 2010, 09:39 PM
More info... I am calling this js fuction on

OnClientLoad

 

="selectTab"

 


of the tabstrip.
I also tried these code, but still getting null for the view. Thanks!

 

var pv = $find("<%=UserTab.PageViewID %>");

 

 

 

 

pv.set_selected(

true); //pv is null :( why??

 

0
Veronica
Telerik team
answered on 23 Jul 2010, 02:45 PM
Hi Kate U,

Have you set MultiPageID property to the RadTabStrip? MultiPageID property must match the ID of the RadMultiPage control.

Best wishes,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ram
Top achievements
Rank 1
answered on 23 Jul 2010, 06:24 PM
Hi Veronica,

yes, MultiPageID  is set properly, since if I manually click on the tab an appropriate view shows up. I am having problem only when I try to programmatically access the pageView for a tab using js :(

Thanks!
Kate
0
Accepted
Veronica
Telerik team
answered on 26 Jul 2010, 10:19 AM
Hi Kate U,

Please accept my appologies for misleading you. The valid MultiPageID is just necessary but not enough condition.
 
pv (corresponding pageView) is null because it is too early to call it at this event. The fact that the RadTabStrip is loaded doesn't necessarily means that the PageView is loaded too.

You can use the exactly same code at the pageLoad() event. This event is fired when the whole page is loaded.

function pageLoad() {
               var tabStrip = $find("<%= SearchTab.ClientID %>");
               var tab = tabStrip.findTabByValue("0");
               if (!tab) {
                   alert("There is no tab with text \"" + text + "\"");
                   return false;
               }
               tab.select();
               alert(tab.get_text());
               //works til this line 
               var pv = tab.get_pageView(); // now pv is null 
               alert(pv.get_id());
               pv.set_selected(true);
           }

Find the full code in the attached .zip file.

Best wishes,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ram
Top achievements
Rank 1
answered on 27 Jul 2010, 12:50 AM
ahhh worked like a charm. Thank you so much :)
Tags
TabStrip
Asked by
Ram
Top achievements
Rank 1
Answers by
Ram
Top achievements
Rank 1
Veronica
Telerik team
Share this question
or