cancel
Showing results for 
Search instead for 
Did you mean: 

How to open a Pop Window after a time delay?

Former Member
0 Kudos

Hi,

I want to open a Pop Up window on click of a checkbox. However the Pop Up window should open after 1 minute.

Can anyone tell me how can I achieve this? Do I need to use TimedTrigger UI Element?

Thanks and Regards,

Monideepa

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi Monideepa

In Post of Shivaramakrishna you replace the statement

this.wait(1000); as

Thread.currentThread.sleep(1000);

I have tried that and Its working fine by changing the above line

Regards

Madhavi

Former Member
0 Kudos

Thank you Madhavi,Siva,Manivannan and Anup for your helpful replies.

The solution given by Siva was helpful but this.wait(1000) was giving an error " java.lang.IllegalMonitorStateException: current thread not owner ". However the solution given by Madhavi to replace this.wait() with

Thread.currentThread().sleep(60000);

solved the error and on click of the checkbox the pop up window opened after 1 minute.

Thanks once again .

Answers (3)

Answers (3)

former_member192434
Active Contributor
0 Kudos

Hi Monideepa,

Create a method in component controller and put this code inside that method and then call this method from checkbox OnAction();

IWDWindowInfo winfo=wdComponentAPI.getComponentInfo().findInWindows("Popwindow");

IWDWindow window1=wdComponentAPI.getWindowManager().createModalWindow(winfo);

window1.setWindowPosition(10,280);

window1.show();

//window1.set

wdContext.currentPopNodeElement().setPopAttribute(window1);

I think this will help to slove ur problem

Thanks

Anup

former_member197348
Active Contributor
0 Kudos

Hi Monideepa,

Create an action and bind it to onToggle property of the checkBox. In implementation of the action handler write code like this:

In the Web Dynpro explorer, open your component, Create a window and create a view and design it as per your requirement.

To wait for 1 minute, you can use wait() or sleep() before you show the window.



String title = "Window Title";
	IWDWindowInfo windowInfo = (IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows("<yourWindowname>");
	//create the  Window
	IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
//  *try this  code for wait* 
	try {
		this.wait(1000);
	} catch (InterruptedException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
//show the window
	window.show();
	window.setWindowPosition(WDWindowPos.CENTER);
	window.setWindowSize(450, 400);
	window.setTitle(title);

Regards,

Siva

Former Member
0 Kudos

Hi Das,

You can use Timedtrigger UI.using the timedTrigger UI element.set the delay property to the time when you want to refresh the screen. in that on action u can write the following code. before write that below u can click method tab then click tab button then choose event handler name is ok finally press ok


							IWDControllerInfo controllerInfo =
								wdControllerAPI.getViewInfo().getViewController();
							String first =
								"open the popup   ";
			
							IWDConfirmationDialog dialog =
								wdComponentAPI.getWindowManager().createConfirmationWindow(
									first,
									controllerInfo.findInEventHandlers("ok"),
									"ok");
			
							dialog.open();

Regards,

P.Manivannan.