Skip to content

Instantly share code, notes, and snippets.

@ebruchez
Created August 18, 2010 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebruchez/533052 to your computer and use it in GitHub Desktop.
Save ebruchez/533052 to your computer and use it in GitHub Desktop.
[ #315215 ] RTE: if disabled when the page loads, it is readonly when it becomes enabled
<html xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:f="http://orbeon.org/oxf/xml/formatting"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:exf="http://www.exforms.org/exf/1-0">
<head>
<xforms:model id="main-model">
<xforms:instance id="control">
<instance xmlns="">
<relevant>false</relevant>
<readonly>false</readonly>
<text>toto</text>
</instance>
</xforms:instance>
<xforms:bind nodeset="instance()/text" relevant="instance()/relevant = 'true'" readonly="instance()/readonly = 'true'"/>
</xforms:model>
</head>
<body>
<xforms:trigger appearance="minimal">
<xforms:label>Toggle relevant</xforms:label>
<xforms:setvalue ev:event="DOMActivate" ref="instance()/relevant" value="if (. = 'true') then 'false' else 'true'"/>
</xforms:trigger> |
<xforms:trigger appearance="minimal">
<xforms:label>Toggle readonly</xforms:label>
<xforms:setvalue ev:event="DOMActivate" ref="instance()/readonly" value="if (. = 'true') then 'false' else 'true'"/>
</xforms:trigger>
<xforms:textarea ref="text" mediatype="text/html" id="gaga"/>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment