Dialog display issue when using Continuations

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

Dialog display issue when using Continuations

Postby rossent » Mon Jun 27, 2011 7:09 pm

Hi all,

We are using Continuations to simulate blocking modal dialogs in the Web Client. However we encounter a strange issue - if a modal dialog is displayed and upon closing of the first dialog a second one is displayed, the Web Client does not show the second dialog. If you use the "Refresh" button on the browser, the second dialog will be displayed when the page is refreshed, but clearly this is not a solution to this problem.

To reproduce the issue, you can use for example the Dialogs Module from Servoy Forge with a simple test like:

Code: Select all
    application.output('Showing first dialog...');
    var _res = globals.DIALOGS.showQuestionDialog('Question Dialog', 'Do you want to display a second dialog?', 'Yes', 'No');
    application.output('The result is: ' + _res);
    if(_res == 'Yes')
    {
        application.output('Showing second dialog...');
        //this second dialog will not be shown in the Web Client until you hit the Refresh button of the browser
        globals.DIALOGS.showQuestionDialog('Second Dialog', 'Is this working?', 'Yes', 'Not Really');
        application.output('After second dialog...');
    }
    else
    {
        application.output('No Second Dialog');
    }
    application.output('Done');


Run the code in both Smart and Web client and notice the difference in behavior. It appears that certain UI changes are not being pushed to the Web Client when Continuations are used. Is this a bug in Servoy or an incorrect usage of Continuations? Any suggestions on how we can make blocking modal dialogs to work on the Web Client is more than welcome.

Thanks for your help.
Rossen Totev
Argos Software
rossent
 
Posts: 288
Joined: Wed Dec 31, 2008 2:03 pm

Re: Dialog display issue when using Continuations

Postby jcompagner » Fri Jul 01, 2011 4:43 pm

this does currently not work on 5.2

For that there need to be code changes in the dialog module:

dialog_base.js

onhide() must be replaced by something like this:
Code: Select all
function onHide(event) {
   if (continuation)  {
      plugins.scheduler.addJob(controller.getName(), new Date(Date.now()), forms.dialogs_base.continueAndDestroy, 0, 0, null, [controller.getName(), continuation, returnValue])
   }
   else {
      plugins.scheduler.addJob(controller.getName(), new Date(Date.now()), forms.dialogs_base.destroyWindow, 0, 0, null, [controller.getName()])
   }
   application.sleep(100);
   return true;
}

function continueAndDestroy(name,continuation,value) {
   continuation(value);
   destroyWindow(name);
}


problem is that in 5.2 also in servoy we need to have some changes,

that code also doesn't work out of the box directly in 6, a refresh is needed to show the second dialog, i am looking into that now.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Dialog display issue when using Continuations

Postby jcompagner » Fri Jul 01, 2011 10:26 pm

fixed it also for 6 so a new build of the dialog_module should work in this case for 5.2.10 and the next RC of 6
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Dialog display issue when using Continuations

Postby ROCLASI » Sat Jul 02, 2011 10:28 am

Version 1.1.2 of the Dialog module is now available on ServoyForge.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium


Return to Web Development

Who is online

Users browsing this forum: No registered users and 13 guests