<xforms:switch> <xforms:case id="delete"> <xforms:trigger appearance="xxforms:link"> <xforms:label>Delete</xforms:label> <xforms:toggle case="confirm" ev:event="DOMActivate"/> </xforms:trigger> </xforms:case> <xforms:case id="confirm"> Are you sure? <xforms:trigger appearance="xxforms:link"> <xforms:label>Delete</xforms:label> <xforms:action ev:event="DOMActivate"> ... Perform actual deletion here ... <xforms:toggle case="delete"/> </xforms:action> </xforms:trigger> <xforms:trigger appearance="xxforms:link"> <xforms:label>Cancel</xforms:label> <xforms:toggle case="delete" ev:event="DOMActivate"/> </xforms:trigger> </xforms:case> </xforms:switch>
Thanks for the comment. In defense of the XForms 1.0 spec though: I am not sure the purpose of a spec in general is to provide code samples. Blogs, articles and books are probably a better place for that.
ReplyDeleteOf course you are free to use good old buttons instead of links :-) That's a good thing about XForms' "intent-driven" user interface: it allows you to very quickly change appearances while keeping the exact same functionality. BTW xxforms:link is non standard, but there is now a suggested way of rendering triggers as links with the use of the "minimal" appearance.