Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_workflow
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenjie.zheng
erp5_workflow
Commits
99963bac
Commit
99963bac
authored
May 20, 2014
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support non-editable mode in FormBox.
parent
ec0d621d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
product/ERP5Form/FormBox.py
product/ERP5Form/FormBox.py
+15
-6
No files found.
product/ERP5Form/FormBox.py
View file @
99963bac
...
...
@@ -88,15 +88,24 @@ class FormBoxWidget(Widget.Widget):
"""
Render a form in a field
"""
here
=
REQUEST
[
'here'
]
# If 'cell' is not defined, we define 'cell' just same as 'here', so
# that we can use the same formbox for both ListBox and non-ListBox
# using 'cell' parameter.
if
not
REQUEST
.
has_key
(
'cell'
):
REQUEST
.
set
(
'cell'
,
here
)
return
self
.
_render
(
field
,
key
,
value
,
REQUEST
,
render_prefix
=
render_prefix
)
def
render_view
(
self
,
field
,
value
,
REQUEST
,
render_prefix
=
None
):
"""
Render a view form in a field
"""
return
self
.
_render
(
field
,
None
,
value
,
REQUEST
,
render_prefix
=
render_prefix
)
def
_render
(
self
,
field
,
key
,
value
,
REQUEST
,
render_prefix
=
None
):
result
=
''
target_id
=
field
.
get_value
(
'formbox_target_id'
)
if
target_id
not
in
(
None
,
''
):
here
=
REQUEST
[
'here'
]
# If 'cell' is not defined, we define 'cell' just same as 'here', so
# that we can use the same formbox for both ListBox and non-ListBox
# using 'cell' parameter.
if
not
REQUEST
.
has_key
(
'cell'
):
REQUEST
.
set
(
'cell'
,
here
)
try
:
form
=
getattr
(
here
,
target_id
)
except
AttributeError
:
...
...
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