﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebDesktop - Accessing WebDesktopManager from Windows With Nested IFrames</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/Accessing-WebDesktopManager-from-Windows-With-Nested-IFrames/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Accessing WebDesktopManager from Windows With Nested IFrames</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/Accessing-WebDesktopManager-from-Windows-With-Nested-IFrames/</link><pubDate>Tue, 17 Nov 2009 15:12:11 GMT</pubDate><dc:creator>alex@millhorn.com</dc:creator><description>&lt;p&gt;Thanks, I will continue to use the syntax:&lt;/p&gt;&lt;p&gt;parent.parent.parent.parent.functionName(paramets); &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;to invoke JavaScript functions on my WebDesktopManager page.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Accessing WebDesktopManager from Windows With Nested IFrames</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/Accessing-WebDesktopManager-from-Windows-With-Nested-IFrames/</link><pubDate>Sun, 15 Nov 2009 22:27:45 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;Unfortunately, when you are using iFrame you will not be able to access the parent functionality &amp; object without referencing it. In your case, perhaps using multiple .parent() function in order to get the WebDesktopManger object.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thank you for the workaround snippet you provided, it will be useful when we are using complex WebDesktopManger.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Accessing WebDesktopManager from Windows With Nested IFrames</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/Accessing-WebDesktopManager-from-Windows-With-Nested-IFrames/</link><pubDate>Sun, 15 Nov 2009 15:58:42 GMT</pubDate><dc:creator>alex@millhorn.com</dc:creator><description>&lt;p&gt;Just to help the community, here is the JavaScript addWnidow function which resides on the actual .aspx with WebDesktopManager1&lt;/p&gt;&lt;pre&gt;    function addWindow(name, text, imageURL, contentURL, width, height, allowMin, allowMax, allowClose)&lt;br /&gt;    {&lt;br /&gt;        var dm = ISGetObject("WebDesktopManager1");&lt;br /&gt;        var wnd = dm.GetWindow(name);&lt;br /&gt;        if (wnd == null)&lt;br /&gt;        {&lt;br /&gt;            wnd = new WebDesktopWindow();&lt;br /&gt;            wnd.Text = text;&lt;br /&gt;            wnd.Name = name;&lt;br /&gt;            wnd.ControlBoxImage = "is_webdesktop-16.gif";&lt;br /&gt;            wnd.ContentURL = contentURL;&lt;br /&gt;            wnd.ContentMode = "UseIFrame";&lt;br /&gt;            wnd.AllowMinimize = allowMin;&lt;br /&gt;            wnd.AllowMaximize = allowMax;&lt;br /&gt;            wnd.AllowClose = allowClose;&lt;br /&gt;            &lt;br /&gt;            dm.Windows.Add(wnd);&lt;br /&gt;            wnd.Show();&lt;br /&gt;            wnd.ResizeTo(width, height);&lt;br /&gt;            wnd.MoveToCenterDesktop();&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            wnd.Activate();&lt;br /&gt;            wnd.Show();&lt;br /&gt;        }&lt;br /&gt;    &lt;br /&gt;    }&lt;br /&gt;    &lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;    &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Accessing WebDesktopManager from Windows With Nested IFrames</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/Accessing-WebDesktopManager-from-Windows-With-Nested-IFrames/</link><pubDate>Sun, 15 Nov 2009 12:10:38 GMT</pubDate><dc:creator>alex@millhorn.com</dc:creator><description>&lt;p&gt;As expressed above, since I have various WebPanes and nested WebTabs in various pages, I was having problems accessing the WebDesktopManager via JavaScript since the number of "parents" varies depending on how many nested IFrames I have.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;As a work around, I've created a class named LinkManager which automatically will create the links for me, and has a parameter to specify the "parentDepth".&lt;/p&gt;
&lt;p&gt;While this works, it would be nicer if there was a way to access WebDesktopManager on child pages without using "parent".  Please let me know if this is possible.&lt;/p&gt;
&lt;p&gt;Is it a bad practice to have multiple nested IFrames.  I realize each one is a seperate web page that needs loaded and thus is more of a load on the server -- but it's my understanding this is a much cleaner way to organize WebPane's and WebTabs as opposed to InLineContent, correct?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;        public static string GetAddWindowCode(string wndName, string wndText, string wndImageURL, string wndContentURL, &lt;br /&gt;                                              int width, int height, bool allowMinimize, bool allowMaximize, bool allowClose)&lt;br /&gt;        {&lt;br /&gt;            return string.Format("addWindow('{0}', '{1}', '{2}', '{3}', {4}, {5}, '{6}', '{7}', '{8}');",&lt;br /&gt;                                        wndName, wndText, wndImageURL, wndContentURL, width, height, &lt;br /&gt;                                        GetYesorNo(allowMinimize), GetYesorNo(allowMaximize), GetYesorNo(allowClose)); // this calls the javascript function on the parentpage that contains WebDesktopManager&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public static string GetAddWindowCode(string wndName, string wndText, string wndImageURL, string wndContentURL,&lt;br /&gt;                                              int width, int height, bool allowMinimize, bool allowMaximize, bool allowClose, int parentDepth)&lt;br /&gt;        {&lt;br /&gt;            string parentString = "";&lt;br /&gt;            for (int i = 0; i &amp;lt; parentDepth; i&amp;#43;&amp;#43;)&lt;br /&gt;            {&lt;br /&gt;                parentString &amp;#43;= "parent.";&lt;br /&gt;            }&lt;br /&gt;            return string.Format("{0}{1}",&lt;br /&gt;                parentString, GetAddWindowCode(wndName, wndText, wndImageURL, wndContentURL, width, height, allowMinimize, allowMaximize, allowClose));&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        public static string GetAddWindowLink(string linkText, string wndName, string wndText, string wndImageURL, string wndContentURL,&lt;br /&gt;                                      int width, int height, bool allowMinimize, bool allowMaximize, bool allowClose, int parentDepth)&lt;br /&gt;        {&lt;br /&gt;            string parentString = "";&lt;br /&gt;            for (int i = 0; i &amp;lt; parentDepth; i&amp;#43;&amp;#43;)&lt;br /&gt;            {&lt;br /&gt;                parentString &amp;#43;= "parent.";&lt;br /&gt;            }&lt;br /&gt;            return string.Format("&amp;lt;a href=# OnClick=\"{0}{1}\"&amp;gt;{2}&amp;lt;/a&amp;gt;",&lt;br /&gt;                parentString, GetAddWindowCode(wndName, wndText, wndImageURL, wndContentURL, width, height, allowMinimize, allowMaximize, allowClose), linkText);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public static string GetAddWindowLink(string linkText, string wndName, string wndText, string wndImageURL, string wndContentURL,&lt;br /&gt;                                              int width, int height, bool allowMinimize, bool allowMaximize, bool allowClose)&lt;br /&gt;        {&lt;br /&gt;            return GetAddWindowLink(linkText, wndName, wndText, wndImageURL, wndContentURL, width, height, allowMinimize, allowMaximize, allowClose, 0);&lt;br /&gt;        }&lt;br /&gt;        public static string GetYesorNo(bool value)&lt;br /&gt;        {&lt;br /&gt;            if (value)&lt;br /&gt;                return "Yes";&lt;br /&gt;            return "No";&lt;br /&gt;        }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Accessing WebDesktopManager from Windows With Nested IFrames</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/Accessing-WebDesktopManager-from-Windows-With-Nested-IFrames/</link><pubDate>Sun, 15 Nov 2009 01:26:17 GMT</pubDate><dc:creator>alex@millhorn.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;What's the best way to access the WebDesktopManager to call a javascript create window function.  To date, I have been including a JavaScript function on the page that has the WebDesktopManager on it.  I call it from panes of windows using the parent.parent.getWindow function&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;    function addWindow(name, text, imageURL, contentURL, width, height, allowMin, allowMax, allowClose)&lt;br /&gt;    {&lt;br /&gt;        var dm = ISGetObject("WebDesktopManager1");&lt;br /&gt;        var wnd = dm.GetWindow(name);&lt;br /&gt;        if (wnd == null)&lt;br /&gt;        {&lt;br /&gt;            wnd = new WebDesktopWindow();&lt;br /&gt;            wnd.Text = text;&lt;br /&gt;            wnd.Name = name;&lt;br /&gt;            wnd.ControlBoxImage = "is_webdesktop-16.gif";&lt;br /&gt;            wnd.ContentURL = contentURL;&lt;br /&gt;            wnd.ContentMode = "UseIFrame";&lt;br /&gt;            wnd.AllowMinimize = allowMin;&lt;br /&gt;            wnd.AllowMaximize = allowMax;&lt;br /&gt;            wnd.AllowClose = allowClose;&lt;br /&gt;            &lt;br /&gt;            dm.Windows.Add(wnd);&lt;br /&gt;            wnd.Show();&lt;br /&gt;            wnd.ResizeTo(width, height);&lt;br /&gt;            wnd.MoveToCenterDesktop();&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            wnd.Activate();&lt;br /&gt;            wnd.Show();&lt;br /&gt;        }&lt;br /&gt;    &lt;br /&gt;    }&lt;br /&gt;    &lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Clearly there must be a better way to access the WebDesktopManager via Javascript from within a Window other than using the parent.Function() method.&lt;/p&gt;
&lt;p&gt;It's especially complicated in my situation where the window has a WebPane which an IFrame which has a Master Page which then loads an IFrame in a WebTab.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>