nsCOMPtr<nsIDOMNode> model = nsXFormsUtils::GetModel(mElement);
nsCOMPtr<nsIModelElementPrivate> modelPriv = nsXFormsUtils::GetModel(mElement); nsCOMPtr<nsIDOMNode> model = do_QueryInterface(modelPriv);
nsXFormsInputElement::Blur(nsIDOMEvent *aEvent){  if (!mControl && !mBoundNode && !mMDG)    return NS_OK;  nsAutoString value;  if (mType == eType_TextArea) {    nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea = do_QueryInterface(mControl);    NS_ENSURE_STATE(textArea);    textArea->GetValue(value);  } else {    nsCOMPtr<nsIDOMHTMLInputElement> input = do_QueryInterface(mControl);    NS_ENSURE_STATE(input);    nsAutoString type;    input->GetType(type);    if (mType == eType_Input && type.EqualsLiteral("checkbox")) {      PRBool checked;      input->GetChecked(&checked);      value.AssignASCII(checked ? "1" : "0", 1);    } else {      input->GetValue(value);    }  }  PRBool changed;  nsresult rv = mMDG->SetNodeValue(mBoundNode, value, PR_TRUE, &changed);  NS_ENSURE_SUCCESS(rv, rv);  if (changed) {    nsCOMPtr<nsIDOMNode> model = nsXFormsUtils::GetModel(mElement);     if (model) {      rv = nsXFormsUtils::DispatchEvent(model, eEvent_Recalculate);      NS_ENSURE_SUCCESS(rv, rv);      rv = nsXFormsUtils::DispatchEvent(model, eEvent_Revalidate);      NS_ENSURE_SUCCESS(rv, rv);              rv = nsXFormsUtils::DispatchEvent(model, eEvent_Refresh);      NS_ENSURE_SUCCESS(rv, rv);            }  }  return NS_OK;}