Fire onchange event when a file is selected from the filepicker. Bug 67873,

r+sr=peterv
This commit is contained in:
bzbarsky%mit.edu 2004-02-19 22:13:47 +00:00
parent 172b44ad4e
commit c0de956a63
2 changed files with 10 additions and 0 deletions

View File

@ -317,6 +317,9 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent)
}
}
// Tell our textframe to remember the currently focused value
mTextFrame->InitFocusedValue();
// Open dialog
PRInt16 mode;
result = filePicker->Show(&mode);
@ -338,6 +341,8 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent)
result = localFile->GetPath(unicodePath);
if (!unicodePath.IsEmpty()) {
mTextFrame->SetProperty(mPresContext, nsHTMLAtoms::value, unicodePath);
// May need to fire an onchange here
mTextFrame->CheckFireOnChange();
return NS_OK;
}
}

View File

@ -317,6 +317,9 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent)
}
}
// Tell our textframe to remember the currently focused value
mTextFrame->InitFocusedValue();
// Open dialog
PRInt16 mode;
result = filePicker->Show(&mode);
@ -338,6 +341,8 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent)
result = localFile->GetPath(unicodePath);
if (!unicodePath.IsEmpty()) {
mTextFrame->SetProperty(mPresContext, nsHTMLAtoms::value, unicodePath);
// May need to fire an onchange here
mTextFrame->CheckFireOnChange();
return NS_OK;
}
}