Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
5368
WebTab EnableLoadOnDemandURL
posted

I am having difficulty with the WebTab EnableLoadOnDemandURL capability.

I feel pretty foolish that I can't seem to figure this out...   It seems like such a basic thing.  I feel like I am missing something fundamental about WebTab implementation... especially since this is so easy to accomplish in UltraWebTab.

I have two ContentURL tabs. 

  • Tab1 contains the URL to a data entry screen
  • Tab2 contains the URL to a "Print Friendly" version of the data entry screen.

EnableLoadOnDemandURL is set to "True".

When I click on each tab initially, I can see the content load in, and all is good.  If I then navigate back to the data entry tab, and make changes.  Then I navigate back to the "Print Friendly" tab (for a second time), the "Print Friendly" page does not reload.  I have ruled out browser caching.

The behavior I am looking for is this:  When you click the tab to navigate to the tab, the tab content URL should reload.

I thought that maybe the "EnableReloadingOnTabClick" property would give me the answer... but it only reloads the page if you click on the currently selected tab.  So, if I a currently have Tab1 selected, and then I click on Tab1, then Tab1 will reload.  However... if I currently have Tab1 selected, and I click Tab2 to navigate to it, Tab2 is not reloaded... despite the "EnableReloadingOnTabClick" value.

I know there's probably some really simple answer that will make me feel tremendously stupid, and I hope y'all can give it to me!

 

 

Parents
  • 24497
    Verified Answer
    posted

    Hi Rob,

    The EnableLoadOnDemandUrl is design to avoid loading iframes of all tabs on initial load (or after a full postback). Once url is loaded it stays loaded.
    There is no option like EnableLoadUrlOfOnlySelectedTab.

    Though it is can be implemented by application while processing selected tab events. The SelectedIndexChanging event is raised before new tab is selected and provides index of that tab. So, application may process that event and remove current url/src from that tab. WebTab checks/validates src of iframe after tab was selected, and if it is different from ContentUrl property, then url is loaded. Below is example:

    <script type="text/javascript">
    function WebTab1_SelectedIndexChanging(sender, eventArgs)
    {
     var index = eventArgs.get_tabIndex();
     // check if url of that tab should be reloaded
     if(index != 0 && index != 1)
      return;
     var tab = sender.getTabAt(index);
     var iframe = tab.get_iframe();
     // remove current url/src from iframe.
     // you can use any "reset" value, though BLOCKED SCRIPT"" is preferrable
     if(iframe)
      iframe.src = 'BLOCKED SCRIPT""';
    }
    </script>
    <ig:WebTab ID="WebTab1" runat="server" ...>
     ...
     <ClientEvents SelectedIndexChanging="WebTab1_SelectedIndexChanging" />
     <PostBackOptions EnableLoadOnDemandUrl="True" />
    </ig:WebTab>

Reply Children