mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
get xforms instance data saved to the workspace.
get radios and comboboxes calling into setFormValue get editor working marginally better get edit to work git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3503 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -110,7 +110,30 @@ function load_body(body, ui_element_stack)
|
||||
var nodeRef = document.createElement("div");
|
||||
nodeRef.setAttribute("style", "height: 200px; border: solid 1px black;");
|
||||
cell.appendChild(nodeRef);
|
||||
var w = dojo.widget.createWidget("Editor", { items: ["|", "bold", "italic", "underline", "strikethrough", "|", "colorGroup", "|", "createLink", "insertImage" ] }, nodeRef);
|
||||
var id = o.getAttribute("id");
|
||||
var initial_value = get_initial_value(o);
|
||||
nodeRef.appendChild(document.createTextNode(initial_value));
|
||||
var w = dojo.widget.createWidget("Editor",
|
||||
{
|
||||
widgetId: id,
|
||||
focusOnLoad: false,
|
||||
items: [ "|", "bold", "italic", "underline", "strikethrough", "|", "colorGroup", "|", "createLink", "insertImage" ]
|
||||
},
|
||||
nodeRef);
|
||||
dojo.event.connect(w,
|
||||
"setRichText",
|
||||
function(event)
|
||||
{
|
||||
dojo.event.connect(w._richText,
|
||||
"onBlur",
|
||||
function()
|
||||
{
|
||||
setXFormsValue(w.widgetId,
|
||||
w._richText.getEditorContent());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
break;
|
||||
case "xforms:input":
|
||||
var id = o.getAttribute("id");
|
||||
@@ -266,11 +289,17 @@ function load_body(body, ui_element_stack)
|
||||
for (var i in values)
|
||||
{
|
||||
var radio = document.createElement("input");
|
||||
radio.setAttribute("id", o.getAttribute("id"));
|
||||
radio.setAttribute("name", o.getAttribute("id"));
|
||||
radio.setAttribute("type", "radio");
|
||||
radio.setAttribute("value", values[i].value);
|
||||
if (values[i].value == initial_value)
|
||||
radio.setAttribute("checked", "true");
|
||||
radio.onclick = function(event)
|
||||
{
|
||||
setXFormsValue(this.getAttribute("id"),
|
||||
this.value);
|
||||
}
|
||||
nodeRef.appendChild(radio);
|
||||
nodeRef.appendChild(document.createTextNode(values[i].label));
|
||||
}
|
||||
@@ -278,6 +307,7 @@ function load_body(body, ui_element_stack)
|
||||
else
|
||||
{
|
||||
var combobox = document.createElement("select");
|
||||
combobox.setAttribute("id", o.getAttribute("id"));
|
||||
nodeRef.appendChild(combobox);
|
||||
for (var i in values)
|
||||
{
|
||||
@@ -288,6 +318,11 @@ function load_body(body, ui_element_stack)
|
||||
option.setAttribute("selected", "true");
|
||||
combobox.appendChild(option);
|
||||
}
|
||||
combobox.onchange = function(event)
|
||||
{
|
||||
setXFormsValue(this.getAttribute("id"),
|
||||
this.options[this.selectedIndex].value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "xforms:submit":
|
||||
@@ -414,7 +449,7 @@ function fireAction(id)
|
||||
mimetype: "text/xml",
|
||||
load: function(type, data, evt)
|
||||
{
|
||||
alert("fired action " + id);
|
||||
// alert("fired action " + id);
|
||||
},
|
||||
error: function(type, e)
|
||||
{
|
||||
|
Reference in New Issue
Block a user