I need to recover the url of the a UltraWebTab.tab after she changes in his/her internal navigation. How do I make that?
I get to recover the initial url of the tab and after navigating in the it paginates of the web that opens inside of the tab the address url the initial stays of when the tab was created.
the code in javascript is:
function RecoverUrlTab() { var ultraTab = igtab_getTabById("uwtConsultarProcesso"); if(ultraTab != null) { var Tabs = ultraTab.Tabs; for(i = 0; i < Tabs.length; i++) { var tab = ultraTab.Tabs[i]; var target = tab.getTargetUrl(); } } }
I thank who can help!
Hi,
You may use tab.elemIframe member. For example:
var tab = ultraTab.Tabs[i];var url = tab.getTargetUrl(); // or tab.targetUrlif(url) tab.elemIframe.src = url;
There are also other objects to use like tab.elemIframe.contentWindow.location, etc. However, all that probably is available only within local server. If user will go to www or something like that, then security of browser will block your access to all those objects and you will not get current location (or iframe.src).
Viktor, thank you for the answer, my problem was solved.
Hi Oamike,
I wrote for you sample which will do what you probably need. The only problem, is size on initialization maybe wrong because target url is not loaded yet. I used delay with 500ms, however, it can be not enough. You may try to enhance that initialization logic. Maybe add interval with checks if iframe is loaded, process onload within targetUrl and call adjustTab on main page, etc. Similar operations can be quite complex and not related to tab.
<script type="text/javascript">function adjustTab(id, oWebTab, oTab){ if(id) { oWebTab = igtab_getTabById(id); if(!oWebTab) return; oTab = oWebTab.getSelectedTab(); } var cp = document.getElementById(oWebTab.ID + '_cp'); var doc = oTab ? oTab.getTargetUrlDocument() : null; if(!doc || !cp) return; var body = doc.body; var width = body.offsetWidth, height = body.offsetHeight; cp.style.width = (width + 70) + 'px'; cp.style.height = (height + 70) + 'px';}function UltraWebTab1_AfterSelectedTabChange(oWebTab, oTab, oEvent){ adjustTab(null, oWebTab, oTab);}function UltraWebTab1_InitializeTabs(oWebTab){ window.setTimeout('adjustTab("' + oWebTab.ID + '")', 500);}</script> <igtab:UltraWebTab ID="UltraWebTab1" runat="server"> <ClientSideEvents AfterSelectedTabChange="UltraWebTab1_AfterSelectedTabChange" InitializeTabs="UltraWebTab1_InitializeTabs" /> <Tabs> <igtab:Tab Text="New Tab"> <ContentPane TargetUrl="Temp.aspx"> </ContentPane> </igtab:Tab> <igtab:Tab Text="New Tab"> <ContentPane TargetUrl="DialogUrl.aspx"> </ContentPane> </igtab:Tab> </Tabs> </igtab:UltraWebTab>
Viktor
Is there a way to set the WebTab to auto-resize - based on the content of the current tab, and not the size of the window on the client?
Or is this method described above 'better'?
I'd prefer for my user's browser window to have the scroll bar, and not my tab control...
I am using a master page with the UltraWebTab - and TargetUrls for each ContentPane (all TargetUrls are pages I server from ASP.NET)