Button: Reference Information
In the tables of this topic, you can find reference information about buttons.
Conversion from ASPX to HTML and TypeScript
The following tables will help you to convert ASPX elements that are related to buttons to HTML or TypeScript elements.
ASPX | HTML or TypeScript |
---|---|
PXButton
|
Is replaced by the qp-button
tag.
|
CommandName
|
Is replaced by the state.bind attribute, which binds the
button to the specified action defined in a
graph.
|
DialogResult
|
Is replaced by dialog-result attribute, which specifies the
response returned by an action. This attribute is required for the standard buttons
of a dialog box. This attribute can have any of the following values:
|
Enabled
|
Is replaced by the enabled attribute, which indicates (if
set to true) that the button is enabled on the
UI.
|
ID
|
Is replaced by the id attribute. This is a required
attribute.
|
Text
|
Is replaced by the caption attribute, which defines the text
that is displayed on the button. The string specified in this attribute is
localizable.
|
Size | Is replaced by the class attribute, which indicates how many columns of width athe button should occupy. |
Visible
|
Is replaced by the hidden attribute, which indicates (if set
to true) that the button is not visible on the
UI.
|
ASPX Control | Properties |
---|---|
PXButton |
|
PXDSCallbackCommand | All properties |
qp-button
The following table lists the properties of the qp-button control, which represents a button in HTML.
Property | Description |
---|---|
caption | Specifies the text that is displayed on the button. The string specified in
this attribute is localizable. If the button has the dialog-result
attribute specified and the caption attribute value is the same
as the dialog-result value, you can omit the
caption attribute. |
class | Species the CSS class for the button. The class can indicate how many columns
of width the button should occupy relative to the width of its parent
control. The code class="col-7" above indicates that
the button occupies 7 columns of width (out of 12) relative to the width of
its parent control. |
dialog-result | Defines the response returned by the performed action. This attribute is
required for the standard buttons of a dialog box, such as OK
and Cancel. This attribute can have any of the following values:
|
enabled | Specifies whether the button should be enabled or disabled on the UI. A
true value indicates that the button is enabled, whereas a false
value indicates that it is
disabled.
|
hidden | Indicates whether the button should be hidden or visible on the UI. A
true value indicates that the button is hidden, whereas a false
value indicates that it is
visible.
|
id | Specifies the id of the button. This attribute is
required.
|
imageSrc | Determines the source of the image displayed on the
button.
|
pushed | Specifies whether the button is in the pushed state. |