• Using dialog control from Extension Library

    By Andrew J Reeve 1 decade ago

    I amended your code to use an control from the extension library rather than the dijit.Dialog dojotype.

    The dialogs do not work in the same way as I expected, and I don't understand why.

    With the dijit.Dialog, there is one POST (as expected), whereas with the dialog contol there are always two POSTs (the first to names.nsf as expected, the second to refresh the dialog).

    If the login is successful then it doesn't matter because the page is redirected to the successful login url. If the login failed, then the user doesn't see the failure reason.

        alert(1)
        dojo.xhrPost({
            url: loginurl,
            handleAs: 'text',
            content: {'username' : dojo.byId('#{id:username}').value, 'password' : dojo.byId('#{id:password}').value},
            load : function(response, data) {
                alert(2)
                ....

    Using firebug I can see that both POSTs occur between the two alerts

    I was wondering if you had tried to get use a dialog control rather then dijit.Dialog, and if so had had sucess with it

    • xe:dialog needs two partial refreshes to pop itself up

      By F. Kranenburg 1 decade ago

      I haven't tried the xe:dialog control for this, but I'm sure I never will. The xe:dialog needs two serverside partial refreshes before it pops-up. This is even before the user can login. If you wan't to use this dialog then you will see 4-5 posts to your server for a simple login.

      Another reason was that at the time I developed this, the xe:dialog didn't work in IE8/IE9.

       

      But developing a new login dialog using the xe:dialog is possible, but you will need to prevent any partial refreshes or submits inside the dialog (because it will be closed then). I think you will need all the dojo.xhrPost code from this control to let it work.

      I can help you with it, just let me know.

       

      Ferry Kranenburg

       

      • Thanks

        By Andrew J Reeve 1 decade ago

        I understand the need for the partial refreshes to display the dialog. What I don't understand is the partial refresh after the xhrPost to names.nsf.

        As your control works, I will be using this for now, and maybe come back to the xe:dialog problem if I have time later.