cancel
Showing results for 
Search instead for 
Did you mean: 

Position of an non modal external window

Former Member
0 Kudos

How is it possible to set the position of an non modal external window?

I've tried it over

window.setWindowPosition(new WDCssSize(500,WDWindowUnitOfLength.PX),new WDCssSize(200, WDWindowUnitOfLength.PX));

and also over

window.setWindowPosition(500,200);

The result is always the same, the window is shown on the top left.

Best regards,

Thomas

Accepted Solutions (1)

Accepted Solutions (1)

former_member197348
Active Contributor
0 Kudos

Hi Thomas,

I set window position for a modal window and it worked for me. But you are using this for non modal external window. I am not sure that we can set position for external window too.

Have a trial like this.

Set the window size first then set position like

window.setWindowSize(500,200);
window.setWindowPosition(100,200);

Check your browser options too to open in a new window.

Regards,

Siva

Answers (11)

Answers (11)

Former Member
0 Kudos

i think i know what the problem is.

Before i show the pdf in the window, i get it from the server and store is as an CachedResource.

I've tried now to show the pdf directly from the server url and now i can control the layout of the window.

Problem is, i need to show the file from the cache for security and performance reason.

Any idea how can i do this?

Former Member
0 Kudos

Hi Thomas,

I guess this is some compatibility issue. Try the following things:

1) Check with the following code on your side:


IWDWindow pop1=wdComponentAPI.getWindowManager().createNonModalExternalWindow("http://www.google.com","google");
	pop1.setWindowSize(512,600);
	pop1.setWindowPosition(50,100);
	
	pop1.show();

Make changes in position and size. See if its working.

2) Try to check it on IE 6.0 or lesser or Mozilla 4.0. May be some compatibility issue is there.

I do not have any particular reason for your question. Some minor thing is missing here.

As you wrote its working for Inteenet Address may be something to do with the compatibility issue.

Regards.

Rajat

Former Member
0 Kudos

With an internet adress it is working. I've tested this allready.

Question is now, why it doesn't work in my case when i want to show an pdf file that is stored on an server?

Former Member
0 Kudos

Hi Thomas,

I tried the same. The code I tried is:


IWDWindow pop1=wdComponentAPI.getWindowManager().createNonModalExternalWindow("http://www.google.com","google");
	pop1.setWindowSize(512,600);
	pop1.setWindowPosition(50,100);
	
	pop1.show();

Its working fine for me. Even I tried changing the parameters for size and position. It worked fine.

Just 1 thing I noted in you post. You gave the code as:

window.setWindowSize(512;400);

although I think it should be

window.setWindowSize(512,400);

I do not know whether it was a typo or its in the application(it would have been syntax error in your application).

I am using IE 6.0. May be its something to do with the versioning.

Regards.

Rajat

Former Member
0 Kudos

I'm using an NonModalExternalWindow.

The window is created over

IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(res.getUrl(WDFileDownloadBehaviour.OPEN_INPLACE.ordinal()), this.wdComponentAPI.getTextAccessor().getText(IMessageZahlflow.VIEW_BELEG));

over


window.setWindowSize(512;400);
window.setWindowPosition(50,50);

the layout of the window is changed.

former_member197348
Active Contributor
0 Kudos

Hi Thomas,

I tried this for you and I could get the solution too. As I told earlier you you need to change your browser settings too. Since you are using IE 7.0, try like this:

In IE,

Click on Tools in the menubar (in IE top-right).

Select Internet Options.

A pop-up will come

Under the General tab, we have 4 sections. 1.Home Page 2.Browsing History 3.Search 4. Tabs

Click on Settings button in Tabs section.

Here we have 3 sections of settings

The below two section are radio buttons,

For, When pop-up is encountered : Always open pop-ups in a new window

Open links from other programs in: A new window

Then click on OK.

And main popup also click on OK.

Close the browser and open your application in a new window. You will see the result that you wanted

Regards,

Siva Rama Krushna.

Former Member
0 Kudos

Hi Thomas,

Which type of external window are you creating, i.e., ExternalWindow or NonModalExternalWindow?

Also if possible give the complete code you are using?

May be there is something wrong in the code?

Regards.

Rajat

Former Member
0 Kudos

I tried it over

 window.setWindowPosition(WDWindowPos.CENTER); 

but the result is the same. Positioning information are not taken.

Window still open on the top left of the screen.

Former Member
0 Kudos

Changing the postion works in an ConfirmationWindow. I've tested it already.

But i want to show content from an external server in the windows. ( pdf files etc...)

Former Member
0 Kudos

if not necessarily you want the window by providing pixel values, you may go for this:


window.setWindowPosition(WDWindowPos.CENTER);

Former Member
0 Kudos

Hi,

As mentioned in the documentation of the IWDWindowMnager.

In 6.30+, the window must be amodal.

Regards,

Gayathri.

Former Member
0 Kudos

I investigate the problem further and tried also the solutions that where provided here.

In Firefox the resizing of the window works without problems. In IE 7 still the same result.

Resizing is not taken in account.

former_member751941
Active Contributor
0 Kudos

Hi Thomas,

Try this..

String dialog = "Do you Want to Close the Application (Yes/No) ? " ;

IWDConfirmationDialog confDialog = wdComponentAPI.getWindowManager().createConfirmationWindow(dialog,wdThis.wdGetAPI().getViewInfo().getViewController().findInEventHandlers("Yes"),"Yes");

confDialog.addChoice(wdThis.wdGetAPI().getViewInfo().getViewController().findInEventHandlers("No"),"No");

confDialog.setTitle("Validation Window");

confDialog.setWindowPosition(WDWindowPos.TOP);

confDialog.setWindowSize(200,100);

confDialog.open();

Thanking You,

Mithu

Edited by: Mithu Ghosh on Jan 15, 2009 10:51 AM

Former Member
0 Kudos

Hi Thomas,

Have you tried decreasing the starting location of the window, i.e., rather than starting from 500 start from 100 and then check. May be the size of your window is exceeding and so it is taking the default settings.

Because I tried the same thing using the following code:

{pop1.setWindowPosition(50,50);}

and it worked and even i changed the parameters and even then it worked.

Regards.

Rajat