<modaldialog>
A modal dialog

JavaScript: lz.modaldialog

The <modaldialog> tag creates a moveable floating view. When opened, the user cannot interact with any other part of the application until the dialog is closed. A modal dialog is typically declared on the canvas. It is automatically centered horizontally and appears vertically at the top third of the screen. The position can be altered by setting an explicit x and y position in the tag.

<canvas height="300">
  <modaldialog name="mydialog" width="300" height="200">
    <text>Are you really sure you want to do something?</text>
    <view align="right" layout="axis:x; spacing:20">
      <button onclick="parent.parent.close()">Cancel</button>
      <button onclick="parent.parent.close()" isdefault="true">OK</button>
    </view>
    <simplelayout spacing="5"/>
  </modaldialog>

  <button onclick="canvas.mydialog.open()">Open Dialog</button>
</canvas>

See Also:

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
content_inset_bottom expression any 10 read/write
  The bottom inset for the dialog contents from the edge of the window inner frame.
content_inset_left expression any 14 read/write
  The left inset for the dialog contents from the edge of the window inner frame.
content_inset_right expression any 14 read/write
  The right inset for the dialog contents from the edge of the window inner frame
content_inset_top expression any 10 read/write
  The top inset for the dialog contents from the edge of the window inner frame.

Methods

close()
modaldialog.close(ignore);
Closes the dialog.
Parameter Name Type Description
ignore    

open()
modaldialog.open();
Opens the dialog (use this method, not setVisible). While the dialog is open, the user will not be able to interact with other windows or UI elements in the application.

Methods inherited from <basewindow>

close, open, setWindowFocus

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy