xmlui: added boolean type management in XMLUIResult2DataFormResult
This commit is contained in:
parent
8ee9e2529e
commit
3fdca75224
1 changed files with 8 additions and 0 deletions
|
|
@ -49,6 +49,10 @@ def dataForm2XMLUI(form, submit_id, session_id=None):
|
|||
__field_type = "string"
|
||||
elif field.fieldType == 'text-private':
|
||||
__field_type = "password"
|
||||
elif field.fieldType == 'boolean':
|
||||
__field_type = "bool"
|
||||
if field.value is None:
|
||||
field.value = "false"
|
||||
elif field.fieldType == 'list-single':
|
||||
__field_type = "list"
|
||||
else:
|
||||
|
|
@ -387,6 +391,10 @@ class XMLUI(object):
|
|||
|
||||
def addBool(self, name=None, value="true"):
|
||||
"""Add a string box"""
|
||||
if value=="0":
|
||||
value="false"
|
||||
elif value=="1":
|
||||
value="true"
|
||||
assert value in ["true", "false"]
|
||||
elem = self._createElem('bool', name, self.currentLayout)
|
||||
elem.setAttribute('value', value)
|
||||
|
|
|
|||
Loading…
Reference in a new issue