Skip to content

Commit

Permalink
try to fix #89
Browse files Browse the repository at this point in the history
  • Loading branch information
d-maurer committed Dec 2, 2019
1 parent e882d35 commit 6fb1e88
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/z3c/form/browser/checkbox.rst
Expand Up @@ -172,10 +172,8 @@ Check HIDDEN_MODE:
<span class="option">
<input type="hidden" id="widget-id-0" name="widget.name:list"
class="checkbox-widget" value="true" />
</span><span class="option">
<input type="hidden" id="widget-id-1" name="widget.name:list"
class="checkbox-widget" value="false" />
</span>
<input name="widget.name-empty-marker" type="hidden" value="1" />

The checkbox json_data representation:
>>> from pprint import pprint
Expand Down Expand Up @@ -334,14 +332,15 @@ Check HIDDEN_MODE:
... (zope.interface.Interface, IDefaultBrowserLayer, None, None, None),
... IPageTemplate, name='hidden')

>>> widget.value = 'true'
>>> widget.value = 'selected'
>>> widget.mode = interfaces.HIDDEN_MODE
>>> print(widget.render())
<span class="option">
<input type="hidden" id="widget-id-0"
name="widget.name:list"
class="single-checkbox-widget" value="selected" />
</span>
<input name="widget.name-empty-marker" type="hidden" value="1" />


Term with non ascii __str__
Expand Down
7 changes: 5 additions & 2 deletions src/z3c/form/browser/checkbox_hidden.pt
@@ -1,8 +1,8 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:omit-tag="">
<span class="option"
tal:repeat="item view/items">
<tal:repeat repeat="item view/items">
<span class="option" tal:condition="item/checked">
<input id="" name="" value="" class="hidden-widget" title=""
tabindex="" accesskey=""
type="hidden"
Expand Down Expand Up @@ -33,4 +33,7 @@
accesskey view/accesskey;
onselect view/onselect" />
</span>
</tal:repeat>
<input name="field-empty-marker" type="hidden" value="1"
tal:attributes="name string:${view/name}-empty-marker" />
</html>

0 comments on commit 6fb1e88

Please sign in to comment.