DhtmlxWindow setViewport Exception When attached to parent

Hi,
I use dhtmlxWindow In IE7.

In a DhmtlxTabbar Content page, I would like to pop up a window and attached to the page which contain the DhmtlxTabbar controlls. But an Exception is reported and failed.

Would you like give me some help or suggestion?

Thank you very much.

My example code is as follows:

/In A.aspx*************/
this.AccreditTabbar=new dhtmlXTabBar(accreditTabDiv,“top”);
this.AccreditTabbar.setImagePath("…/Dhtmlx/imgs/");
this.AccreditTabbar.setHrefMode(“iframes-on-demand”);

this.AccreditTabbar.addTab(“Application”,“ProductApplicaiton”,“100px”);
this.AccreditTabbar.setContentHref(“Application”,"B.aspx);
this.AccreditTabbar.setTabActive(“Application”);

/In B.aspx**/
this.dhxWins = new dhtmlXWindows();
this.dhxWins.setSkin(“dhx_blue”);
this.dhxWins.attachEvent(“onContentLoaded”, function(win) {win.progressOff();});
this.dhxWins.enableAutoViewport(false);
//an exception is threw when running this line. I plan to let A.aspx as viewport
this.dhxWins.setViewport(10, 10, 900, 800,parent.document);
var ProductSelectWindow = this.dhxWins.createWindow(“ProductSelectWindow”, 250, 50,720, 530);

Hello,

You’d better init dhtmlxWindows woth default viewport (document.body) directly from attached page.

Hello,Andrei,

  If I init dhtmlxWindows with default viewport directly from attached page, The windows will be localized in the attached page and are not displayed in the center of the screen, which will bring bad experience to users.

But then you’d better init windows on document.body for main page. Or you want to use modality only on tab content? (If you’re using modality)

Hello, Andrei,

  Actually,  as a compromise,  now I init windows on document.body for main page. 

  But the Application Logic is now changed as follows: the main page pop up a window,  the window call a function of the main window by parent object, then the main window forward the call to the tab content page, which finally get the data from poped window to update the tab content page.
   
   Therefore, I feel  it is a bit ugly in encapslation. 
   
    Because  the main page is our basic framework, there are nine tabs and need to pop up many windows. I think that encapsulating  creation  of these windows and their processing in the tab content window would be a good choice, which is independent of the main page of framework.

Hello.

Hmmm. Okey then.

Could you please provide two completed demos with tabbar and windows for case of your first post (that is not working as you want) and for you last post (with document.body init). I will check how it works (by second demo) and probably will suggest how to implement it for your first demo.

Hello, Andrei,

That is very kind of you.

But Please wait for two days because I am busy in my project.

After two days, I will pack up the two demo and upload to you.

Thanks!

Hello,

I especially provide the two demo with the attachment. 

 One is what I hoped but It failed, the other is now adopted solution but it is beyond my expected disign.

I would like you give me a better solution or some advice.

Personally I think that  initing window  and receiving the returned data  should be placed in the content page because the clicked button which lead to pop the window  is in the content page.

But at the same time, in order to let the window center on the page, it looks necessary to set parent documnet as viewport.

 Thanks!

Compromised But Working Demo.rar (1.84 KB)
Hoped But Failed Demo.rar (2.04 KB)

Hello,

Please see attached demo.
Unpack all and exec /failed/MainPage.htm
43.zip (66.3 KB)

Hello,

I run mainpage.htm in IE7.  The exception still exists, if I delete the comment in ContentPage.htm to  call  setViewport.

Please note that: Uncomment the code in ContentPage.htm,

/********************************************************
 Attention:
 Exception from the two line codes,which are used to set the MainPage as viewport to let the pop window display on the center of screen.
		
   dhxWins.enableAutoViewport(false);
   dhxWins.setViewport(10, 10, 1000, 1000, parent.document);
*******************************************************/

Hello,

Please see record of demo on our side in IE7. What wrong?
1.avi.rar (564 KB)

Hello, Andrei,

  The wrong message is :" htmlfile: invalid parameter"  in function setviewport

   I try to upload the new  error demo and record of the demo on our side in IE7

   But the forum tell me: 

   Sorry, the board attachment quota has been reached.

   may I have other methods to give you the error demo and its record ?

Hi,

Please send your demo directly to support@dhtmlx.com
(Insert somewhere link to this topic in yuor mail).

Hello, Andrei,

I already  sent the demo and related record to you.

 Thank you very much!