cancel
Showing results for 
Search instead for 
Did you mean: 

Dialog box which block current execution

Joseph_BERTHE
Active Contributor
0 Kudos

Hi,

I'm looking for a solution which show me up a pop-up dialog box, and after the creation of this, it will block the execution of my main code until the user click on the OK button into the popup dialog box.

I try to use modal window, but it doesn't block the execution.

e.g.

CODE A

CREATION DIALOG BOX

SHOW DIALOG BOX

CODE B

when the dialog is shown, then the code B is executed only if we destroy the dialog box.

Thanks

Regards,

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

good

go through these links, which ll give you brief idea about the dialog box and the execution procedure.

https://weblogs.sdn.sap.com/pub/wlg/4513?page=last&x-showcontent=off [original link is broken] [original link is broken] [original link is broken] [original link is broken]

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9cb5d345-0801-0010-6a8e-fc5...

thanks

mrutyun^

Joseph_BERTHE
Active Contributor
0 Kudos

Hi,

Thanks for your links, but I'm using WD for Java. Furthermore, I don't get the relation with dialog box.

Regards,

Former Member
0 Kudos

Berthe,

If you are using WD for Java then:

1. Use IWDWindowManager (wdComponentAPI.getWindowManager()) to create confirmation dialog.

2. In some action handler run code A, then open confirmation dialog

3. In event handler for button in confirmation dialog place code B.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Joseph_BERTHE
Active Contributor
0 Kudos

Hi Valery,

Thanks for your answer. It is the solution that I'm using and it works fine.

But I'm wondering if there was others suitable solutions.

Thanks anyway

Former Member
0 Kudos

Berthe,

Unfortunately, there are no simplier solution with WD. In some other Java web frameworks like Cocoon (with Javaflow support, Java) or RIFE (Java) or Seaside (Smalltak) you may use continuations. So you can write liniear code in for:


List modifiedRecords = getModifiedRecords();
boolean confirmUpdate = queryUserAndWait("Modify records?", modifiedRecords);
if (confirmUpdate) 
  updateRecords(modifiedRecords);

In aforementioned frameworks thread state is serialized and response is sent back to user when queryUserAndWait method invoked. After user submits answer, frameworks restore erxecution state of thread and resume (continue, hence continuations) execution right after queryUserAndWait method return.

Again, in WD you have to emulate this behavior with separate action/event handlers.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Joseph_BERTHE
Active Contributor
0 Kudos

Hi,

Sorry but I don't understand your solution :(. It sounds good, but I don't get it.

Otherwise, I don't understand an other thing. I've made this code but it desn't work at all:

IWDWindowInfo windowInfo = (IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows("ScheduleLinesChoiceBox");

IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo, true);

window.setWindowPosition(WDWindowPos.CENTER);
window.setTitle("ATP Control");
window.open();

wdContext.currentContextElement().setScheduleLinesPossibleWindow(window);
wdContext.currentContextElement().setWait(true);
	
while(wdContext.currentContextElement().getWait());

With your framework, how can I implement it with this requirement ?

Regards,

Joseph_BERTHE
Active Contributor
0 Kudos

There is my requirement :

do

...

some instructions

...

Ask to my client something (pop-up/confirmation)

if (yes)

do something

else

do something

...

next customer

while (customer != null)

Former Member
0 Kudos

Berthe,

Sorry for confusing you, it was just a rant that something like you whant is available in <b>other web frameworks, not in WebDynpro</b>

VS

Joseph_BERTHE
Active Contributor
0 Kudos

Hi Valery,

Thanks anyway.

But for the future of WebDynpro, it should be interresting to have a such dialog box.

Kind regards,