iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I have a WebDesktop project and I am trying to figure out how to programmatically set the size of the Ifram that loads the aspx page.
I want to change the wnd.resize to something that will look at the size of the page it is loading and resize the iframe to that size
Her is my code to create and load the window:
if (wnd == null && shortcut.Name == "ClaimSearch") {
wnd = new WebDesktopWindow();
wnd.Text = "Claim Search";
wnd.Name = "wndClaimSearch";
wnd.TaskBarImage = "is_webdesktop-16.gif";
wnd.ControlBoxImage = "is_webdesktop-16.gif";
wnd.ContentURL = "ClaimSearch.aspx";
wnd.ContentMode = "UseIFrame";
wnd.AllowMinimize = "Yes";
wnd.AllowMaximize = "No";
dm.Windows.Add(wnd);
wnd.ResizeTo(830, 840);
wnd.Show();
wnd.MoveToCenterDesktop();
}
Thanks.
I have a WebDesktop project and I am trying to figure out how to programmatically set the size of the Ifram that loads the aspx page....
...
Following snippet code shows how set the width of iframe element of WebDesktopWindow.
function Debug() { var dm = ISGetObject("WebDesktopManager1"); var wnd = dm.GetWindow("myWindow"); if (wnd == null) { var wndIframeElement = wnd.GetWindowIFrameElement(); wndIframeElement.style.width = "500px"; } }
This should helps.
Thanks Yudi, But that is not what I am asking for.
Here is what I am trying to do:
I create a new IFrame window:
var wnd = dm.GetWindow("wndClaimSearch");
I set all the valid properties of the window: wnd = new WebDesktopWindow();
wnd.ContentURL = "ClaimSearch.aspx"; (Want to set iframe to this size)
Now I would like to Size or Resize the IFrame window to match the size of ClaimSearch.aspx
wnd.ResizeTo(width of ClaimSearch.aspx, height of ClaimSearch.aspx);
I do not want to set the size manually, I want it to look at the content page and adjust the IFrame to that size.
Hello Steve,
Based on your explanation, are you trying to have a fluid behavior of the ClaimSearch.aspx so it always fills up the window? If so, may I suggest you to fix all of the ClaimSearch content to have width and height that is 100%? Hope this helps.
Best Regards,Erwin Sanders
No, I am trying to create a frame that wraps around the content page it is bringing in.
I cannot change the size of the content page that the frame is loading.
Sorry for the delay in sending this.
Here is what I created based on your scenario: JavaScript function is be used to create and show WebDesktopWindow. The WebDesktopWindow will load an image and use iFrame as its ContentMode. The snippet is as follow:
function AddWindow() { var dm = ISGetDesktopManager(); var wnd = dm.GetWindow("wndAboutDM"); if (wnd == null) { wnd = new WebDesktopWindow(); wnd.Name = "wndHTMLPage"; wnd.ContentURL = "../Images/coverflow_images/timesquare.jpg"; wnd.ContentMode = "UseIFrame"; wnd.AllowMinimize = "No"; wnd.AllowMaximize = "No"; dm.Windows.Add(wnd); wnd.Show(); } else { wnd.Activate(); } }
Next, in order to get the dimension of the image (ContentURL of WebDesktopWindow), the image will be appended to a dummy element.
function ResizeWebDesktopWindow(imgSrc, wnd) { var element = document.getElementById("dummyElement"); var elem = document.createElement("img"); elem.src = imgSrc; elem.setAttribute("style", "visibility: collapse;"); elem.addEventListener('load', function () { var imgWidth = this.naturalWidth; var imgHeight = this.naturalHeight; wnd.ResizeTo(imgWidth, imgHeight); }); element.appendChild(elem); }
As you may see, the WebDesktopWindow is now resized based on the size of its content. In this simple case, is an image. Call ResizeWebDesktopWindow function after invoking Show() method, so the AddWindow() function will look like below after modified:
function AddWindow() { var dm = ISGetDesktopManager(); var wnd = dm.GetWindow("wndAboutDM"); if (wnd == null) { wnd = new WebDesktopWindow(); wnd.Text = "HTML Page"; wnd.Name = "wndHTMLPage"; wnd.ControlBoxImage = "is_webdesktop-16.gif"; wnd.ContentURL = "../Images/coverflow_images/timesquare.jpg"; wnd.ContentMode = "UseIFrame"; wnd.AllowMinimize = "No"; wnd.AllowMaximize = "No"; dm.Windows.Add(wnd); wnd.Show(); ResizeWebDesktopWindow("http://mywebsite/Images/coverflow_images/timesquare.jpg", wnd) } else { wnd.Activate(); } }
Hope this helps.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname