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:
A single JavaScript function to run (typically just calling one of your predefined functions).
The label to appear on the button.
The hover help text to float over button.
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.
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)")")> @param(1) </a>