Permalink
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (70 sloc) 3.53 KB
<!--
Copyright (C) 2016 Orbeon, Inc.
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU Lesser General Public License as published by the Free Software Foundation; either version
2.1 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
-->
<xbl:xbl
xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:xbl="http://www.w3.org/ns/xbl"
xmlns:xxbl="http://orbeon.org/oxf/xml/xbl">
<xbl:binding
id="fr-checkbox-input-binding"
element="fr|checkbox-input, xf|input:xxf-type('xs:boolean')[appearance ~= checkbox]"
xxbl:mode="lhha custom-lhha binding value selection"
xxbl:container="span">
<metadata xmlns="http://orbeon.org/oxf/xml/form-builder">
<display-name lang="en">Single Checkbox</display-name>
<display-name lang="es">Casilla de Verificación</display-name>
<display-name lang="fi" todo="true">[Single Checkbox]</display-name>
<display-name lang="fr">Case à cocher unique</display-name>
<display-name lang="ru" todo="true">[Single Checkbox]</display-name>
<display-name lang="it" todo="true">[Single Checkbox]</display-name>
<display-name lang="de">Einzelnes Kontrollkästchen</display-name>
<display-name lang="sv">Ensam kryssruta</display-name>
<display-name lang="nl" todo="true">[Single Checkbox]</display-name>
<display-name lang="pt" todo="true">[Single Checkbox]</display-name>
<icon>
<small-icon>/forms/orbeon/builder/images/checkbox.png</small-icon>
<large-icon>/forms/orbeon/builder/images/checkbox.png</large-icon>
</icon>
<templates>
<bind type="xf:boolean"/>
<instance>false</instance>
<view>
<fr:checkbox-input>
<xf:label ref=""/>
<xf:hint ref=""/>
<xf:help ref=""/>
<xf:alert ref=""/>
</fr:checkbox-input>
</view>
</templates>
</metadata>
<xbl:template>
<xf:select appearance="full" ref="xxf:binding('fr-checkbox-input-binding')" xbl:attr="xxf:encrypt-item-values">
<xf:hint mediatype="text/html" value="xxf:hint('fr-checkbox-input-binding')"/>
<xf:item>
<xf:label mediatype="text/html" value="xxf:label('fr-checkbox-input-binding')"/>
<xf:value xbl:attr="xbl:text=selected-value">true</xf:value>
</xf:item>
<xf:setvalue
event="xforms-select"
ref="."
xbl:attr="xbl:text=selected-value">true</xf:setvalue>
<xf:setvalue
event="xforms-deselect"
ref="."
xbl:attr="xbl:text=deselected-value">false</xf:setvalue>
</xf:select>
</xbl:template>
</xbl:binding>
</xbl:xbl>