Created
August 21, 2010 01:03
-
-
Save ebruchez/541554 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xhtml:html xmlns:xforms="http://www.w3.org/2002/xforms" | |
xmlns:f="http://orbeon.org/oxf/xml/formatting" xmlns:xhtml="http://www.w3.org/1999/xhtml" | |
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:xs="http://www.w3.org/2001/XMLSchema" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:widget="http://orbeon.org/oxf/xml/widget" | |
xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes" | |
xmlns:xbl="http://www.w3.org/ns/xbl" xmlns:fr="http://orbeon.org/oxf/xml/form-runner"> | |
<xhtml:head> | |
<xforms:model id="main" | |
xxforms:session-heartbeat="true" | |
xxforms:show-error-dialog="false" | |
xxforms:external-events="submit-save submit-preview submit-cancel"> | |
<xforms:instance id="instance"> | |
<root> | |
<repeat> | |
<item> | |
<title/> | |
<node-selector/> | |
</item> | |
</repeat> | |
</root> | |
</xforms:instance> | |
<xforms:instance id="proto-property"> | |
<item> | |
<title/> | |
<node-selector/> | |
</item> | |
</xforms:instance> | |
<xforms:bind nodeset="instance('instance')"> | |
<xforms:bind | |
nodeset="repeat/item/title" | |
type="xs:boolean" | |
required="true()" /> | |
<xforms:bind | |
nodeset="repeat/item/node-selector" | |
relevant="../title = 'true'" /> | |
</xforms:bind> | |
</xforms:model> | |
<xbl:xbl xmlns:xhtml="http://www.w3.org/1999/xhtml" | |
xmlns:xforms="http://www.w3.org/2002/xforms" | |
xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
xmlns:ev="http://www.w3.org/2001/xml-events" | |
xmlns:xi="http://www.w3.org/2001/XInclude" | |
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude" | |
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" | |
xmlns:fr="http://orbeon.org/oxf/xml/form-runner" | |
xmlns:saxon="http://saxon.sf.net/" | |
xmlns:oxf="http://www.orbeon.com/oxf/processors" | |
xmlns:xbl="http://www.w3.org/ns/xbl" | |
xmlns:xxbl="http://orbeon.org/oxf/xml/xbl" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xbl:script src="/apps/xforms-sandbox/samples/input-counted.js" /> | |
<xbl:binding id="fr-input-counted" element="fr|input-counted"> | |
<xbl:template xxbl:transform="oxf:unsafe-xslt"> | |
<xsl:transform version="2.0"> | |
<xsl:import href="oxf:/oxf/xslt/utils/xbl.xsl" /> | |
<xsl:template match="/*"> | |
<xforms:group xbl:attr="model context ref bind" xxbl:scope="outer"> | |
<xbl:content includes="xforms|label" /> | |
<xsl:copy-of select="xxbl:parameter(., 'max')" /> | |
<xxforms:script ev:event="xforms-enabled"> | |
YAHOO.xbl.fr.InputCounted.instance(this).init(); | |
</xxforms:script> | |
<xforms:group xxbl:scope="inner"> | |
<xxforms:variable name="binding" as="node()?"> | |
<xxforms:sequence select="." xxbl:scope="outer"/> | |
</xxforms:variable> | |
<xforms:input id="input-counted" class="fr-input-counted" ref="$binding" incremental="true" /> | |
<label class="counter-label"></label> | |
</xforms:group> | |
</xforms:group> | |
</xsl:template> | |
</xsl:transform> | |
</xbl:template> | |
</xbl:binding> | |
</xbl:xbl> | |
</xhtml:head> | |
<xhtml:body class="body"> | |
<div> | |
<xforms:trigger appearance="full"> | |
<xforms:label> | |
Add Another | |
</xforms:label> | |
<xforms:insert ev:event="DOMActivate" | |
nodeset="repeat/item"/> | |
</xforms:trigger> | |
</div> | |
<xforms:repeat nodeset="repeat/item"> | |
<div> | |
<xforms:input id="title" ref="title"> | |
<xforms:label>Make input relevant</xforms:label> | |
</xforms:input> | |
</div> | |
<div> | |
<fr:input-counted ref="node-selector" max="10"> | |
<xforms:label>Node Selector </xforms:label> | |
</fr:input-counted> | |
</div> | |
</xforms:repeat> | |
</xhtml:body> | |
</xhtml:html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment