The ephox:button element embeds an action button in the document that, when clicked, activates a function of the editor. Typically, action buttons are used to insert, remove or move XML element in the document, however they can also be used to raise events that activate custom functionality or to re-evaluate the XSLT.
Maintaining an awareness of the context node is very important when using the ephox:button element. For more information on how the context node is used when implementing Ephox action buttons please see the section on Understanding the Current Element or Context Node.
Action buttons do not enable and disable based on XSD values, they will always perform their specified function. For example, an ephox:button element with the action of xmlRemove will always remove the relevant element when clicked. It will not disable, even when the minimum occurrences, as specified in the XSD, is reached.
Specifies the action to perform when the button is clicked. The value must be one of the following:
getCurrentNodeValue - Get the value of the current node and supply the value, along with an ID for the element to the callback function. The SetXMLNodeValue function can then be used to set a new value for the current node.
xmlInsertAtCurrent - Insert an element as a child of the current element.
xmlInsertAfter - Insert an element after the current element.
xmlInsertBefore - Insert an element before the current element.
xmlRemove - Remove the current element.
xmlMoveUp - Moves the current element before it's previous sibling.
xmlMoveDown - Moves the current element after it's next sibling.
raiseEvent - Raise an event back to the browser or to the embedding application.
updateView - Re-evaluate the XSLT to update the view. This is useful when the output of the XSLT changes depending on the values of specific elements.
The value associated with the action. For actions that insert an XML element, the value should be the namespace and local name of the element to insert, separated by a colon. For example to insert a new optionalElement in the http://www.ephox.com/product/editliveforxml/document/Untitled namespace, the value would be:
http://www.ephox.com/product/editliveforxml/document/Untitled:optionalElement
When running as an applet, the raiseEvent and getCurrentNodeValue actions use the value as the name of the JavaScript function to call, otherwise the value is provided by the getExtraString() method of the TextEvent that is raised.
The xmlRemove, xmlMoveUp, xmlMoveDown and updateView actions ignore the value attribute.
The text to display on the button.
The URL to the image to use for the button. The default images used are 16 pixels by 16 pixels however the image can be any size.
Copyright 2001-2005 Ephox Corporation. All Rights Reserved.