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

RadPageView set_contentUrl client side issue.

3 Answers 269 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
KracsNZ
Top achievements
Rank 1
KracsNZ asked on 16 Feb 2011, 03:15 AM
We have a RadTabStrip + RadMultiPage on our main page. The menu system is loaded once and the menu items create the tabs + corresponding pageview in javascript (i.e. completely client-side). The pages being loaded are full .aspx pages, i.e. the multipage is being used as a tabbed MDI.

However we're having major issues with the client-side pageview function set_contentUrl.

// add the tab
var tab = new Telerik.Web.UI.RadTab();
tab.set_text(name);
mainTabStrip.trackChanges();
mainTabStrip.get_tabs().add(tab);
mainTabStrip.commitChanges();
 
// add the multiview   
var pageView = new Telerik.Web.UI.RadPageView();
pageView.set_contentUrl(url);
mainMultiPage.trackChanges();
mainMultiPage.get_pageViews().add(pageView);
pageView.get_element().id = ("PageView_" + pvCnt);
pvCnt += 1
mainMultiPage.commitChanges();

It does not appear to function well at all. No content is displayed in the pageview at all. However I do believe it is trying to load the page. If I change the url to a secure website with an invalid certificate I can the security warning in IE that the content is being blocked.

If I ignore the set_contentUrl and build the iframe myself (as below), it works perfectly.

var tab = new Telerik.Web.UI.RadTab();
tab.set_text(name);
mainTabStrip.trackChanges();
mainTabStrip.get_tabs().add(tab);
mainTabStrip.commitChanges();
 
// add the multiview   
var pageView = new Telerik.Web.UI.RadPageView();
mainMultiPage.trackChanges();
mainMultiPage.get_pageViews().add(pageView);
pageView.get_element().id = ("PageView_" + pvCnt);
pvCnt += 1
 
pageView.get_element().innerHTML = "<iframe src=\""+ url + "\" frameBorder=\"0\" style=\"width: 100%; height: 100%;\"></iframe>";
 
mainMultiPage.commitChanges();

Is there something I'm missing in the first example, or can't I do that at client-side with the pageview.

3 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 17 Feb 2011, 03:32 PM
Hello KracsNZ,

In the Ticket Info I see that you are using version 2010. 3 1317. We had some problems with implemeting the contentUrl on the client. However everything is fixed in the latest internal build. Please try it and let me know how it goes.

Kind regards,
Veronica Milcheva
the Telerik team
0
Danko
Top achievements
Rank 1
answered on 25 Feb 2011, 03:52 PM
Hi,

I have a similar problem:

I have a tabstrip with a multipage where some pageviews are defined declaratively and some are loaded clientside with contenturl.
The issue is that one of the declarative pageviews has 2 Rad Editors and:

With the current production build (2010.3.1317), when setting the clienturl on the clientside, the pageview got created (div was created) but the iframe to hold the content did not get created. Instead, both Rad Editors on a different pageview got replaced with the content that I was trying to load in the new pageview.

With the latest dev build (2010.3.1422), doing the same thing creates the new pageview, creates the iframe and populates it (like it is supposed to) but it STILL also replaces both rad editors with the content of the new pageview.

My guess is that you are using jquery and are incorrectly finding the iframe to populate with the content - that is, your jquery selector returns all the iframes in the multipage instead of just the new one. I tried adding just a plain iframe to another pageview and it also got populated which supports my theory above.

For now, I am going to set the content html as an iframe with the url that I need. That should fix my problem but you guys need to fix yours.

For the record, this is the code I am using to create the new pageview. Please let me know if I am doing something wrong.

function TabStrip_OnTabSelecting(sender, args)
{
    var tab = args.get_tab();
     
    // load new pageview if there isn't one already
    if (! tab.get_pageViewID())
    {
        var tabstrip = $find("<%= this.tabsPages.ClientID %>");
        var multipage = $find("<%= this.mvwPages.ClientID %>");
        var pageview = new Telerik.Web.UI.RadPageView();
 
        pageview.set_id("pv" + tab.get_value());
        pageview.set_contentUrl("someurl");
         
        multipage.trackChanges();
        multipage.get_pageViews().add(pageview);
        multipage.commitChanges();
 
        tabstrip.trackChanges();
        tab.set_pageViewID(pageview.get_id());
        tabstrip.commitChanges();
 
        pageview.select();
    }
}


Igor
0
Veronica
Telerik team
answered on 28 Feb 2011, 09:58 AM
Hello Igor,

Could you please send me your test project that reproduces the issue with version 2010.3.1422? Thank you! 

Kind regards,
Veronica Milcheva
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
TabStrip
Asked by
KracsNZ
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Danko
Top achievements
Rank 1
Share this question
or