2.2.106 button (1)

The button element specifies a button on a control menu and its associated action that MUST be performed when the button is pressed.

Parent Elements

menu

menuArea

toolbar

Attributes:

action: This attribute specifies the control action that is performed. This attribute MUST be specified for buttons that manipulate the following controls:

  • xCollection: A repeating section control, as specified in section 2.3.1.11, or a repeating table control, as specified in section 2.4.1.16.

  • xOptional: An optional section control, as specified in section 2.4.1.18.

  • xFileAttachment: A file attachment control, as specified in section 2.3.1.7.

The specified value MUST be one of the following:

  • xCollection::insert: This action inserts a new section after all existing sections.

  • xCollection::insertBefore: This action inserts a new section before the current section.

  • xCollection::insertAfter: This action inserts a new section after the current section.

  • xCollection::remove: This action deletes the current section.

  • xCollection::removeAll: This action deletes all existing sections.

  • xOptional::insert: This action inserts a new section after the current section.

  • xOptional::remove: This action deletes the current section.

  • xFileAttachment::attach: This action attaches a file to the form file.

  • xFileAttachment::open: This action opens an attached file.

  • xFileAttachment::saveAs: This action saves an attached file out of the form file.

  • xFileAttachment::remove: This action removes an attached file from the form file.

caption: This attribute specifies the caption that MUST be displayed on the button. The value MUST be defined.

icon: This attribute MUST be ignored.

name:  This attribute MUST be ignored.

showIf: This attribute MUST<3> be ignored. . The specified value MUST be one of the following:

  • always: This value is deprecated.

  • enabled: This value is deprecated.

  • immediate: This button SHOULD show if the menu is shown.

tooltip: This attribute MUST be ignored.

xmlToEdit: This attribute specifies the name of the control for which the button is used. The specified value MUST match the value of the name attribute of the corresponding xmlToEdit element, as specified in section 2.2.124. This attribute MUST be defined for buttons used with collection controls.

The following W3C XML Schema ([XMLSCHEMA1] section 2.1) fragment specifies the contents of this element.

 <xsd:element name="button">
   <xsd:complexType>
     <xsd:attribute name="caption" type="xsf:xdTitle"/>
     <xsd:attribute name="icon" type="xsd:string"/>
     <xsd:attribute name="tooltip" type="xsf:xdTitle"/>
     <xsd:attribute name="name" type="xsd:NMTOKEN"/>
     <xsd:attribute name="xmlToEdit" type="xsd:NMTOKEN"/>
     <xsd:attribute name="action">
       <xsd:simpleType>
         <xsd:restriction base="xsd:NMTOKEN">
           <xsd:enumeration value="xCollection::insert"/>
           <xsd:enumeration value="xCollection::insertBefore"/>
           <xsd:enumeration value="xCollection::insertAfter"/>
           <xsd:enumeration value="xCollection::remove"/>
           <xsd:enumeration value="xCollection::refreshFilter"/>
           <xsd:enumeration value="xCollection::removeAll"/>
           <xsd:enumeration value="xOptional::insert"/>
           <xsd:enumeration value="xOptional::remove"/>
           <xsd:enumeration value="xReplace::replace"/>
           <xsd:enumeration value="xFileAttachment::attach"/>
           <xsd:enumeration value="xFileAttachment::open"/>
           <xsd:enumeration value="xFileAttachment::saveAs"/>
           <xsd:enumeration value="xFileAttachment::remove"/>
         </xsd:restriction>
       </xsd:simpleType>
     </xsd:attribute>
     <xsd:attribute name="showIf">
       <xsd:simpleType>
         <xsd:restriction base="xsd:NMTOKEN">
           <xsd:enumeration value="always"/>
           <xsd:enumeration value="enabled"/>
           <xsd:enumeration value="immediate"/>
         </xsd:restriction>
       </xsd:simpleType>
     </xsd:attribute>
   </xsd:complexType>
 </xsd:element>