Button

amx:commandButton

The Button component generates an action event (i.e. perform an action or navigate to another page) when pressed. It can contain label, an icon, or both. The button commonly consists of the following elements:

This component is commonly used on tablets and phones.

Appearance

Appearance characteristics for this component.

Behavior

Common behaviors for this component.

Usage

Usage guidelines for this component.

Sample

AMX sample code for this component.

The following is a sample code for a Default Style Button with Text Label:

<amx:facet name="primary">
<amx:commandButton id="cb1" text="Cancel" action="cancel" actionListener="#{myBean.rollback}"/>
</amx:facet>

The following is a sample code for a Default Style Button with Image Icon:

<amx:facet name="primary">
<amx:commandButton id="cb1" icon="plus.png" action="add" actionListener="#{myBean.AddItem}"/>
</amx:facet>

The following is a sample code for a Default Style Button with Image Icon:

<amx:facet name="footer">
<amx:commandButton id="cb2" icon="folder.png" text="Move (#{myBean.mailcount})" action="move"/>
</amx:facet>

The following is a sample code for a Back Style Button with Text Label:

<amx:facet name="primary">
<amx:commandButton id="cb1" text="Back" action="__back"/>
</amx:facet>

The following is a sample code for a Highlight Style Button with Text Label:

<amx:facet name="secondary">
<amx:commandButton id="cb2" text="Save" action="save" styleClass="adfmf-commandButton-highlight"/>
</amx:facet>

The following is a sample code for an Alert Style Button with Text Label:

<amx:commandButton id="cb1" text="Delete" actionListener="#{myBean.delete}" styleClass="adfmf-commandButton-alert" />

Related

Fig 1. iOS Buttons

 

Fig 2. Android Buttons