Visual Builder

Get Involved. Join the Conversation.

Topic

    Venkata P
    Dialog box is auto closing and not opening againAnswered
    Topic posted October 26, 2019 by Venkata PGreen Ribbon: 100+ Points, tagged JET, Layout, UI, Web 
    29 Views, 2 Comments
    Title:
    Dialog box is auto closing and not opening again
    Summary:
    Page has a dialog box which opens on click of button and closing automatically
    Content:

    Hi All,

    My page has a dialogbox which opens on click of button. First it opens as expected. When you click on the button again it auto closes and never opens again.

    Could you let me know what went wrong here. Below is html code and and java script.

    HTML Code :

            <div id="dialogWrapper">
              <oj-dialog style="display:none" id="modalDialog1" title="Modal Dialog">
                <div slot="body">
                   The dialog window can be moved, resized and closed with the 'x' icon.
                   Arbitrary content can be added to the the body and footer sections.
                </div>
                <div slot="footer">
                  <oj-button id="okButton" data-bind="click: function() {
                      document.querySelector('#modalDialog1').close();
                    }">  OK
                  </oj-button>
                </div>
              </oj-dialog>
              <oj-button id="buttonOpener" data-bind="click: function() {
                  document.querySelector('#modalDialog1').open();
                }">
                Open Modal Dialog
              </oj-button>
            </div>

    Java Script:

    define([], function() {
      'use strict';

      var PageModule = function PageModule() {};

      return PageModule;
    });

     

     

    Version:
    19.3.1.2
    Image:
    Code Snippet:

    Comment