411 REFERENCE · Wikibooks
XSLTForms/Triggers not working
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
A common cause of triggers not working is that the actions in the trigger are not listening for any events.
The following trigger illustrates the problem. It is meant, when activated, to replace the value of the current element with the string "Hello <strong>World</strong>!". But nothing happens when the trigger is pressed.
<trigger xmlns="http://www.w3.org/2002/xforms">
<label>Hello World!</label>
<setvalue ref="."
value="'Hello <strong>World</strong>!'"
/>
</trigger>
The solution is to specify the event(s) which will cause the setvalue action to fire.
<trigger xmlns="http://www.w3.org/2002/xforms">
<label>Hello World!</label>
<setvalue ev:event="DOMActivate"
xmlns:ev="http://www.w3.org/2001/xml-events"
ref="."
value="'Hello <strong>World</strong>!'"
/>
</trigger>