Topic
  • 7 replies
  • Latest Post - ‏2014-05-08T09:50:42Z by ChrisHouben
wisenose
wisenose
125 Posts

Pinned topic DojoDialog closable property

‏2009-11-19T11:26:07Z |

In some cases asynchronous events are beautiful, in some cases they are not.
When a user requests some data through a webservice, I want our users to wait until the webservice has answered. To accomplish that I use the DojoDialog (v0.7.1.1) in RBD 7.5.1.4, and set closable to false. I would expect the dialog cannot be closed manually (by escape-key or closing the dialog-window) as long as the dialog is not hidden by my program.
This is not the case, even with closable set to false, the dialog can be closed, and control is given back to the user. I attached my code. To simulate the webservice call I built in a 3-second relay (with thanks to Arco). Do I do something wrong, or could it be a minor bug in the DojoDialog?
Of course, there are other ways to block user access, but I think this is the fanciest.
Attachments:
DialogTest.egl
Updated on 2010-03-18T17:04:38Z at 2010-03-18T17:04:38Z by SystemAdmin
  • rcasey
    rcasey
    28 Posts

    Re: DojoDialog closable property

    ‏2009-11-20T19:36:58Z  
    There could be a problem with DojoDialog. The example program DojoDialogSample shows the same behavior you describe. The dialog is defined with "closable=false", but the dialog box has an active close button.

    If the problem is fixed, make sure you have a way to close the dialog box, otherwise you'll be stuck!

    One method I've used to block repeated calls to a webservice is to disable/enable the control that calls it. For example, let's say I define a button that calls a webservice when clicked. In the button's onClick method, I disable the button (button.disabled=true) and then call the service. In the callback function, I enable the button (button.disabled=false).

    You could even change the button's label to give an indication of what is going on, or display a message elsewhere on your screen.
  • wisenose
    wisenose
    125 Posts

    Re: DojoDialog closable property

    ‏2009-11-23T08:25:35Z  
    • rcasey
    • ‏2009-11-20T19:36:58Z
    There could be a problem with DojoDialog. The example program DojoDialogSample shows the same behavior you describe. The dialog is defined with "closable=false", but the dialog box has an active close button.

    If the problem is fixed, make sure you have a way to close the dialog box, otherwise you'll be stuck!

    One method I've used to block repeated calls to a webservice is to disable/enable the control that calls it. For example, let's say I define a button that calls a webservice when clicked. In the button's onClick method, I disable the button (button.disabled=true) and then call the service. In the callback function, I enable the button (button.disabled=false).

    You could even change the button's label to give an indication of what is going on, or display a message elsewhere on your screen.

    hi richard,

    blocking the control while the webservice is running is one thing I understand. but I want to block the entire ui, or at least the part of the ui that controls the webservice call.
    why? suppose a user clicks a row in a grid, and a webservice is called to fetch the selected record(s), I do not want the user to interfere with the userinterface while the fetching of data is running and the detail-screen is presented to the user. what happens with the handling of the webservice call when the user clicks another row while the service is running, or even decides to leave the grid/subfile and start another ui/menu/grid? in either case, I would like to control the application's behavior. I would prefer some kind of timeout-handling on the webservice over the user interfering with the handling of the webservice call. but of course, that's another discussion of which I am very curious to know how you guys think of this aspect of EGL/Rich UI.
    guus
  • rcasey
    rcasey
    28 Posts

    Re: DojoDialog closable property

    ‏2009-11-25T18:15:10Z  
    • wisenose
    • ‏2009-11-23T08:25:35Z

    hi richard,

    blocking the control while the webservice is running is one thing I understand. but I want to block the entire ui, or at least the part of the ui that controls the webservice call.
    why? suppose a user clicks a row in a grid, and a webservice is called to fetch the selected record(s), I do not want the user to interfere with the userinterface while the fetching of data is running and the detail-screen is presented to the user. what happens with the handling of the webservice call when the user clicks another row while the service is running, or even decides to leave the grid/subfile and start another ui/menu/grid? in either case, I would like to control the application's behavior. I would prefer some kind of timeout-handling on the webservice over the user interfering with the handling of the webservice call. but of course, that's another discussion of which I am very curious to know how you guys think of this aspect of EGL/Rich UI.
    guus
    Still looking to see why the closable property of a DojoDialog is being ignored.

    I did see a reference to "closeable" in DojoDialog.js, but couldn't find any other reference to it.

    Regarding timeout handling, you do have that option with the call to your webservice.

    call service.serviceName(...parms...)
    returning to myCallbackFunction
    onException handleException{timeout = xxxx};

    That doesn't solve the problem of the user interface being active while the webservice is being called, but does give you a way of dealing with a webservice that doesn't respond.

    I wonder what happens if a webservice returns a response, but takes longer than the timeout value to do so. Is that response discarded, or does it stick around and pop up when you least expect it!
    Richard
    Updated on 2009-11-25T18:15:10Z at 2009-11-25T18:15:10Z by rcasey
  • SystemAdmin
    SystemAdmin
    6195 Posts

    Re: DojoDialog closable property

    ‏2010-03-18T02:13:14Z  
    • rcasey
    • ‏2009-11-25T18:14:39Z
    Still looking to see why the closable property of a DojoDialog is being ignored.

    I did see a reference to "closeable" in DojoDialog.js, but couldn't find any other reference to it.

    Regarding timeout handling, you do have that option with the call to your webservice.

    call service.serviceName(...parms...)
    returning to myCallbackFunction
    onException handleException{timeout = xxxx};

    That doesn't solve the problem of the user interface being active while the webservice is being called, but does give you a way of dealing with a webservice that doesn't respond.

    I wonder what happens if a webservice returns a response, but takes longer than the timeout value to do so. Is that response discarded, or does it stick around and pop up when you least expect it!
    Richard
    Was a fix ever offered for this bug regarding the closable property not working? I was able to find a workaround my editing the Dialog.css in one of the other themes. If its possible to actually correct the problem I would prefer to do that. Thanks
  • SystemAdmin
    SystemAdmin
    6195 Posts

    Re: DojoDialog closable property

    ‏2010-03-18T17:04:38Z  
    Was a fix ever offered for this bug regarding the closable property not working? I was able to find a workaround my editing the Dialog.css in one of the other themes. If its possible to actually correct the problem I would prefer to do that. Thanks
    Sorry for the delay in getting back to you on this. The close property is an annoying bug with dojo that is still to be resolved. You can see the bug for Dojo here: http://bugs.dojotoolkit.org/ticket/9670 The plan is to have it fixed in 1.5. 1.5 should be coming out this summer.

    In the meantime you'll need to modify the CSS to disable the close icon:

    .dijitDialogCloseIcon {
    display:none;
    }

    There are some other solutions around the internet, but they are more hacks than anything.

    http://whatsthepointeh.blogspot.com/2009/03/catching-dijits-dialog-close-event.html
    http://codewut.de/content/disable-close-button-dojo-dijitdialog

    Sorry for the trouble,
    George
  • David.Durand
    David.Durand
    12 Posts

    Re: DojoDialog closable property

    ‏2014-02-11T20:24:18Z  
    Sorry for the delay in getting back to you on this. The close property is an annoying bug with dojo that is still to be resolved. You can see the bug for Dojo here: http://bugs.dojotoolkit.org/ticket/9670 The plan is to have it fixed in 1.5. 1.5 should be coming out this summer.

    In the meantime you'll need to modify the CSS to disable the close icon:

    .dijitDialogCloseIcon {
    display:none;
    }

    There are some other solutions around the internet, but they are more hacks than anything.

    http://whatsthepointeh.blogspot.com/2009/03/catching-dijits-dialog-close-event.html
    http://codewut.de/content/disable-close-button-dojo-dijitdialog

    Sorry for the trouble,
    George

    I realize this is probably a dead issue, maybe it is time to at least remove it from the documentation.  Or post the CSS hack in there instead.

  • ChrisHouben
    ChrisHouben
    15 Posts

    Re: DojoDialog closable property

    ‏2014-05-08T09:50:42Z  

    Somebody has a working solution as example for the EGL widgets ?

     

    Greets,

    Chris