Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Georgios Dagkakis
erp5
Commits
a64d97cb
Commit
a64d97cb
authored
Aug 04, 2016
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] stringfield.render now support being called multiple times
parent
e3eb3402
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
11 deletions
+23
-11
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_stringfield_js.js
...ateItem/web_page_module/rjs_gadget_erp5_stringfield_js.js
+21
-9
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_stringfield_js.xml
...teItem/web_page_module/rjs_gadget_erp5_stringfield_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_stringfield_js.js
View file @
a64d97cb
...
@@ -20,26 +20,38 @@
...
@@ -20,26 +20,38 @@
})
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
element
,
var
element
,
text
,
field_json
=
options
.
field_json
||
{}
,
field_json
=
options
.
field_json
||
{}
;
created
=
false
;
this
.
props
.
value
=
field_json
.
value
||
field_json
.
default
||
""
;
this
.
props
.
value
=
field_json
.
value
||
field_json
.
default
||
""
;
this
.
props
.
editable
=
field_json
.
editable
;
this
.
props
.
editable
=
field_json
.
editable
;
if
(
field_json
.
editable
)
{
if
(
field_json
.
editable
)
{
element
=
document
.
createElement
(
'
input
'
);
element
=
this
.
element
.
querySelector
(
'
input
'
);
element
.
setAttribute
(
"
type
"
,
"
text
"
);
if
(
element
===
null
)
{
element
=
document
.
createElement
(
'
input
'
);
element
.
setAttribute
(
"
type
"
,
"
text
"
);
created
=
true
;
}
element
.
setAttribute
(
'
value
'
,
this
.
props
.
value
);
element
.
setAttribute
(
'
value
'
,
this
.
props
.
value
);
element
.
setAttribute
(
'
name
'
,
field_json
.
key
);
element
.
setAttribute
(
'
name
'
,
field_json
.
key
);
element
.
setAttribute
(
'
title
'
,
field_json
.
title
);
element
.
setAttribute
(
'
title
'
,
field_json
.
title
);
if
(
field_json
.
required
===
1
)
{
if
(
field_json
.
required
===
1
)
{
element
.
setAttribute
(
'
required
'
,
'
required
'
);
element
.
setAttribute
(
'
required
'
,
'
required
'
);
}
else
{
element
.
removeAttribute
(
'
required
'
);
}
}
}
else
{
}
else
{
element
=
document
.
createElement
(
"
p
"
);
element
=
this
.
element
.
querySelector
(
'
p
'
);
element
.
setAttribute
(
"
class
"
,
"
ui-content-non-editable
"
);
if
(
element
===
null
)
{
text
=
document
.
createTextNode
(
this
.
props
.
value
);
element
=
document
.
createElement
(
"
p
"
);
element
.
appendChild
(
text
);
element
.
setAttribute
(
"
class
"
,
"
ui-content-non-editable
"
);
created
=
true
;
}
element
.
textContent
=
this
.
props
.
value
;
}
if
(
created
)
{
this
.
element
.
innerHTML
=
''
;
this
.
element
.
appendChild
(
element
);
}
}
this
.
element
.
appendChild
(
element
);
})
})
.
declareMethod
(
'
getContent
'
,
function
()
{
.
declareMethod
(
'
getContent
'
,
function
()
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_stringfield_js.xml
View file @
a64d97cb
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
49.22535.16679.238
76
</string>
</value>
<value>
<string>
9
53.628.51543.174
76
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -248,7 +248,7 @@
...
@@ -248,7 +248,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
56317346.39
</float>
<float>
14
70314253.13
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
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