fix for initial values for textareas

fix for insert before 

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4518 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ariel Backenroth
2006-12-05 08:43:43 +00:00
parent d8e78b8e22
commit 5c312a7ece

View File

@@ -128,8 +128,14 @@ dojo.declare("alfresco.xforms.Widget",
var binding = this.xform.getBinding(this.xformsNode); var binding = this.xform.getBinding(this.xformsNode);
return binding && binding.readonly == "true()"; return binding && binding.readonly == "true()";
}, },
setInitialValue: function(value)
{
this.initialValue = value;
},
getInitialValue: function() getInitialValue: function()
{ {
if (typeof this.initialValue != "undefined")
return this.initialValue;
var chibaData = _getElementsByTagNameNS(this.xformsNode, var chibaData = _getElementsByTagNameNS(this.xformsNode,
CHIBA_NS, CHIBA_NS,
CHIBA_NS_PREFIX, CHIBA_NS_PREFIX,
@@ -311,13 +317,6 @@ dojo.declare("alfresco.xforms.TextField",
this.widget.style.width = "100%"; this.widget.style.width = "100%";
this.domNode.appendChild(this.widget); this.domNode.appendChild(this.widget);
// this.widget = dojo.widget.createWidget("ValidationTextBox",
// {
// widgetId: this.id + "-widget",
// required: this.isRequired(),
// value: initial_value
// },
// this.domNode);
if (this.isReadonly()) if (this.isReadonly())
{ {
this.widget.setAttribute("readonly", this.isReadonly()); this.widget.setAttribute("readonly", this.isReadonly());
@@ -361,8 +360,6 @@ dojo.declare("alfresco.xforms.TextArea",
this.domNode.innerHTML = this.getInitialValue() || ""; this.domNode.innerHTML = this.getInitialValue() || "";
tinyMCE.addMCEControl(this.domNode, this.id); tinyMCE.addMCEControl(this.domNode, this.id);
tinyMCE.getInstanceById(this.id).iframeElement.onblur = function() { alert('foo'); };
//dojo.event.connect(tinyMCE.getInstanceById(this.id).iframeElement,
var editorDocument = tinyMCE.getInstanceById(this.id).getDoc(); var editorDocument = tinyMCE.getInstanceById(this.id).getDoc();
editorDocument.widget = this; editorDocument.widget = this;
tinyMCE.addEvent(editorDocument, "blur", this._tinyMCE_blurHandler); tinyMCE.addEvent(editorDocument, "blur", this._tinyMCE_blurHandler);
@@ -370,7 +367,8 @@ dojo.declare("alfresco.xforms.TextArea",
}, },
setValue: function(value) setValue: function(value)
{ {
tinyMCE.getInstanceById(this.id).setContent(value); tinyMCE.selectedInstance = tinyMCE.getInstanceById(this.id);
tinyMCE.setContent(value);
}, },
getValue: function() getValue: function()
{ {
@@ -1001,6 +999,7 @@ dojo.declare("alfresco.xforms.Repeat",
if (this.children.length == 0) if (this.children.length == 0)
{ {
dojo.event.browser.stopEvent(event); dojo.event.browser.stopEvent(event);
var repeat = event.target.repeat;
if (!repeat.isInsertRepeatItemEnabled()) if (!repeat.isInsertRepeatItemEnabled())
return; return;
this.setFocusedChild(null); this.setFocusedChild(null);
@@ -1132,7 +1131,8 @@ dojo.declare("alfresco.xforms.Repeat",
this.groupHeaderNode.appendChild(document.createTextNode(label)); this.groupHeaderNode.appendChild(document.createTextNode(label));
this.headerInsertRepeatItemImage = document.createElement("img"); this.headerInsertRepeatItemImage = document.createElement("img");
this.headerInsertRepeatItemImage.repeat = this;
this.groupHeaderNode.appendChild(this.headerInsertRepeatItemImage); this.groupHeaderNode.appendChild(this.headerInsertRepeatItemImage);
this.headerInsertRepeatItemImage.setAttribute("src", WEBAPP_CONTEXT + "/images/icons/plus.gif"); this.headerInsertRepeatItemImage.setAttribute("src", WEBAPP_CONTEXT + "/images/icons/plus.gif");
this.headerInsertRepeatItemImage.style.width = "16px"; this.headerInsertRepeatItemImage.style.width = "16px";