Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
erp5_rtl_support
Commits
7775c2dc
Commit
7775c2dc
authored
Jun 09, 2015
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Formultor: add input_type parameter in TextWidget.
parent
27052298
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
product/Formulator/Widget.py
product/Formulator/Widget.py
+13
-3
No files found.
product/Formulator/Widget.py
View file @
7775c2dc
...
...
@@ -325,7 +325,7 @@ class TextWidget(Widget):
"""Text widget
"""
property_names
=
Widget
.
property_names
+
\
[
'display_width'
,
'display_maxwidth'
,
'extra'
]
[
'display_width'
,
'display_maxwidth'
,
'
input_type'
,
'
extra'
]
default
=
fields
.
StringField
(
'default'
,
title
=
'Default'
,
...
...
@@ -352,13 +352,23 @@ class TextWidget(Widget):
default
=
""
,
required
=
0
)
input_type
=
fields
.
StringField
(
'input_type'
,
title
=
'Input type'
,
description
=
(
"The type of the input field like 'color', 'date', 'email' etc."
"Note input types, not supported by old web browsers, will behave "
"as input type text."
),
default
=
"text"
,
required
=
0
)
def
render
(
self
,
field
,
key
,
value
,
REQUEST
,
render_prefix
=
None
):
"""Render text input field.
"""
display_maxwidth
=
field
.
get_value
(
'display_maxwidth'
)
or
0
input_type
=
field
.
get_value
(
'input_type'
)
or
'text'
if
display_maxwidth
>
0
:
return
render_element
(
"input"
,
type
=
"text"
,
type
=
input_type
,
name
=
key
,
css_class
=
field
.
get_value
(
'css_class'
),
value
=
value
,
...
...
@@ -367,7 +377,7 @@ class TextWidget(Widget):
extra
=
field
.
get_value
(
'extra'
))
else
:
return
render_element
(
"input"
,
type
=
"text"
,
type
=
input_type
,
name
=
key
,
css_class
=
field
.
get_value
(
'css_class'
),
value
=
value
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment