cancel
Showing results for 
Search instead for 
Did you mean: 

create Popup or external window

Former Member
0 Kudos

Hi,

I have some code in wdDoInit() of View. Before view completely loads, I require to popup a dialog box or external window with a message.

Is this possible to create Popup or external window from the first view of the application, such that the popup appears first and then the rest of the view loads?

Presenty I do not get any popup even though I have done coding for the same and straight away the view appears.

Thanks

Anagha

Message was edited by:

Anagha Jawalekar

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hi Anagha,

Create Start view, define context attribute "enabled" type "boolean", delete all UI elements from layout, place timedtrigger UI element, bind "enabled" property to "enabled" context attribute, define action handler for "onAction". Define plug "toMain". Put in wdDoInit:


wdContext.currentContextElement().setEnabled(true);

in onAction action handler:


	IWDWindowManager windowManager = wdComponentAPI.getWindowManager();
	windowManager.createNonModalExternalWindow("http://www.google.com", "Google").show();
	wdContext.currentContextElement().setEnabled( false );
	wdThis.wdFirePlugToMain();

Embed Start view into your window and make it default, bind toMain plug with plug on your main view.

The only disadvantage is 1 sec of delay.

Best regards, Maksim Rashchynski.

Answers (2)

Answers (2)

Former Member
0 Kudos

/people/valery.silaev/blog/2006/10/09/loading-please-wait

former_member751941
Active Contributor
0 Kudos

Hi Anagha,

First go to the Method tab of view and create two Event handlers (“Ok” and “Cancel”).

Then try this code inside wdDoInit() of view.

String dialog = "Do You Want to Continue? ";

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

IWDEventHandlerInfo CancelEventInfo = wdThis.wdGetAPI().getViewInfo().getViewController().findInEventHandlers("Cancel");

confDialog.addChoice(CancelEventInfo,"Cancel");

confDialog.show();

Check this links.

<a href="http://help.sap.com/saphelp_nw70/helpdata/en/0f/134540631d6f13e10000000a1550b0/frameset.htm">Creating an External Window</a>

Regards,

Mithu

Former Member
0 Kudos

Mithu

I remember that a dialog box when opened in the init() stops further loading of the UI or it doesnot open at all due to javascript errors (NW2004). what Maksim says is right. I guess directly opening the dialog box wont work, though not recomended you may choose to open it in if(firstTime) of wdDoModify().

Guess it has to be solved with a round about method using event handlers of the dialog box and then firing to the main view from there using plugs.

regards

LNV