Bug 311475, select/select1 not updated on inserts when using itemset, r=doronr+aaronr+me

This commit is contained in:
Olli.Pettay%helsinki.fi 2005-10-28 18:17:22 +00:00
parent ab5e44bb8d
commit 8082f3a4a0
2 changed files with 14 additions and 6 deletions

View File

@ -193,6 +193,11 @@ nsXFormsItemSetElement::SelectItemByValue(const nsAString &aValue, nsIDOMNode **
NS_IMETHODIMP
nsXFormsItemSetElement::Bind()
{
mModel = nsXFormsUtils::GetModel(mElement);
if (mModel) {
mModel->AddFormControl(this);
}
return NS_OK;
}

View File

@ -136,9 +136,6 @@
this.uiElement.removeAttribute("readonly");
}
if (!this.delegate.hasBoundNode)
return;
this._refreshing = true;
// We detect if the instance data we bind to has changed. If it has,
@ -175,7 +172,10 @@
// select builds its own UI by parsing it's children.
// replace new line (\n), tabs (\t) and carriage returns (\r) with "".
var value = this.delegate.value.replace(/\n|\t|\r/g, " ");
var value = "";
if (this.delegate.value)
value = this.delegate.value.replace(/\n|\t|\r/g, " ");
// get an array of values selected in the bound node
var selectedArray = value.split(" ");
@ -401,6 +401,7 @@
<method name="_setBoundValue">
<body>
<![CDATA[
if (this.delegate.hasBoundNode)
this.delegate.value = this._getSelectedValues();
]]>
</body>
@ -458,7 +459,9 @@
<body>
<![CDATA[
// get an array of values selected in the bound node
var selectedArray = this.delegate.value.split(" ");
var selectedArray = new Array();
if (this.delegate.value)
selectedArray = this.delegate.value.split(" ");
// store the values in a hash for quick access
this._defaultHash = new Object();