@wuiButtonSubmit([ID], [LABEL], [TITLE], [ATTRS], [CONFIRM])

Inserts a <button> entity to submit a specific form.

The following parameters are recognized:

[ID]

The ID of the form to be submitted - if you omit then you need to add your own custom onclick handler.

[LABEL]

Label to appear on button (defaults to "Submit").

[TITLE]

Optional title attribute to appear as a tooltip to the user when their mouse hovers over the button.

[ATTRS]

Optional set of attributes to apply to the button entity. entity.

[CONFIRM]

Add Optional javascript confirmation dialog. A positive confirmation will submit the form otherwise abort.

This macro allows one to insert a <button> into the HTML output with an onclick attribute that will submit a form with the specified ID. If the ID is omitted, it is assumed that you will be providing your own onclick handler. An optional confirmation dialog may be configured.

Example of using the macro:

@wuiButtonSubmit("myform","Process My Data","Click this to process your data",,"Are you sure?")

@wuiButtonSubmit(,"Custom Process","Wow - check this out!","
  @htmlAttr("onclick","myWowFunction();")
  @htmlAttr("onsubmit","validateMyForm();")")
    

Assuming the com.ccg.macros.at.All class is within your CLASSPATH and the config/html.at macros file has been generated (Hint: run make atmacros in the wui directory), a developer should be able to run the above example by copy/pasting from below:

[root@probe root]# java com.ccg.macros.at.All <<EOF
@include("config/html.at",,"d")

@wuiButtonSubmit("myform","Process My Data","Click this to process your data",,"Are you sure?")

@wuiButtonSubmit(,"Custom Process","Wow - check this out!","
  @htmlAttr("onclick","myWowFunction();")
  @htmlAttr("onsubmit","validateMyForm();")")
    
EOF

This macro is defined as:

@htmlEntity("button","@fnb("@param(1)","Submit")
","@ifEqual("@param(0)",,,"
  @htmlAttr("onclick","@ifEqual("@param(4)",,"getElementById('@param(0)').submit();","NstPopup.confirm( { message: '@param(4)', confirmed: function() { getElementById('@param(0)').submit(); } } )")")")
  @htmlAttr("class","wuiInputButton")
  @toolTipAttr("@param(2)")@fnb("@param(3)","@htmlAttr("style","display: inline;")")")