@wuiOnclickButton(JAVASCRIPT, LABEL, [TITLE], [ATAGATTRS], [STYLEATTRS])

Inserts a link into the document which resembles a standard WUI input button and runs a bit of JavaScript when clicked.

The following parameters are recognized:

JAVASCRIPT

A single JavaScript function to run (typically just calling one of your predefined functions).

LABEL

The label to appear on the button.

[TITLE]

The hover help text to float over button.

[ATAGATTRS]

Any extra A tag attributes (other than href, style, class or title to include in the link). Use this parameter instead of title for DOM Tooltips.

[STYLEATTRS]

Any extra style attributes.

Example of using the macro:

<script type="text/javascript">
function myFunction() {
  alert("Hello");
}
</script>

@wuiOnclickButton("myFunction();","My Function","Pressing this calls: myFunction()")

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")

<script type="text/javascript">
function myFunction() {
  alert("Hello");
}
</script>

@wuiOnclickButton("myFunction();","My Function","Pressing this calls: myFunction()")

EOF

This macro is defined as:

<a @htmlAttr("href","javascript:@param(0)")
 @htmlAttr("style","text-align: center;@ifEqual("@param(4)","",""," @param(4)")") @param(3)
 @htmlAttr("class","wuiInputButton")@ifEqual("@param(2)",,,"
 @toolTipAttr("@param(2)")")>&nbsp;@param(1)&nbsp;</a>