protected void SetProcedureCombobox(EformComboBox ProcedureComboBox, EformComboBox ProcedureSurgeon, EformSelect ProcedureSurgeonType, EformComboBox ProcedureAssistant, EformSelect ProcedureAssistantType) { string CheckboxOnclickString = "copyProcedureInputValues(this, '" + OpSurgeon.ClientID + "', '" + ProcedureSurgeon.ClientID + "'); "; CheckboxOnclickString += "copyProcedureInputValues(this, '" + OpSurgeonType.ClientID + "', '" + ProcedureSurgeonType.ClientID + "'); "; CheckboxOnclickString += "copyProcedureInputValues(this, '" + OpAssistant.ClientID + "', '" + ProcedureAssistant.ClientID + "'); "; CheckboxOnclickString += "copyProcedureInputValues(this, '" + OpAssistantType.ClientID + "', '" + ProcedureAssistantType.ClientID + "'); "; ProcedureComboBox.OnClientEvent("onfocus", "if(this.value != this.defaultValue) { " + CheckboxOnclickString + " }"); //ProcedureComboBox.Attributes.Add("onchange", CheckboxOnclickString); }
protected void SetProcedureCheckbox(EformCheckBox ProcedureCheckBox, EformComboBox ProcedureSurgeon, EformSelect ProcedureSurgeonType, EformComboBox ProcedureAssistant, EformSelect ProcedureAssistantType) { string CheckboxOnclickString = "copyProcedureInputValues(this, '" + OpSurgeon_1.ClientID + "', '" + ProcedureSurgeon.ClientID + "'); "; CheckboxOnclickString += "copyProcedureInputValues(this, '" + OpSurgeonType_1.ClientID + "', '" + ProcedureSurgeonType.ClientID + "'); "; CheckboxOnclickString += "copyProcedureInputValues(this, '" + OpAssistant_1.ClientID + "', '" + ProcedureAssistant.ClientID + "'); "; CheckboxOnclickString += "copyProcedureInputValues(this, '" + OpAssistantType_1.ClientID + "', '" + ProcedureAssistantType.ClientID + "'); "; ProcedureCheckBox.Attributes.Add("onclick", CheckboxOnclickString); }
/// <summary> /// /// </summary> /// <param name="con"></param> /// <param name="xmlDoc"></param> /// <param name="inputFieldValue"></param> protected void SetControlValue(IEformInputField con, XmlDocument xmlDoc, string inputFieldValue) { if (inputFieldValue != null) { // TODO: collapse this into a call on the IEformInputField interface if (con is EformTextBox) { EformTextBox temp = (EformTextBox)con; //temp.Value = inputFieldValue; temp.Text = inputFieldValue; } else if (con is EformHidden) { EformHidden temp = (EformHidden)con; // let's experiment string val = inputFieldValue; if (temp.Field.EndsWith("Date")) // we want Dates enabled to pick up the DateText conversion { temp.Disabled = false; // we need to propagate the value here, b/c it would be empty on the page temp.Value = val; } else if (val == null || "".Equals(val)) { temp.Disabled = true; } else { temp.Disabled = false; // persist the value in this case temp.Value = val; } // leave the value alone, keeping what was on the page; // temp.Value = inputFieldValue; } else if (con is EformTextArea) { EformTextArea temp = (EformTextArea)con; //temp.Value = inputFieldValue; temp.Text = inputFieldValue; } else if (con is EformDropDownList) { EformDropDownList temp = (EformDropDownList)con; //temp.Value = inputFieldValue; temp.SelectedValue = inputFieldValue; } else if (con is EformComboBox) { EformComboBox temp = (EformComboBox)con; temp.Value = inputFieldValue; } //else if (con is EformRadioButtonList) //{ // EformRadioButtonList temp = (EformRadioButtonList)con; // string val = inputFieldValue; // if (val != null && !val.Equals("")) // temp.SelectedValue = val; //} else if (con is EformRadioButtonGroup) { EformRadioButtonGroup rg = (EformRadioButtonGroup)con; // tell it to the child controls foreach (Control c in rg.Controls) { if (c is EformRadioButton) { EformRadioButton rb = (EformRadioButton)c; string nodeInnerText = GetNodeValue(rg, xmlDoc); if (nodeInnerText != null && !"".Equals(nodeInnerText)) { if (rb.Value.Equals(nodeInnerText)) { rb.Checked = true; } } } } } else if (con is EformRadioButton) { EformRadioButton rb = (EformRadioButton)con; string nodeInnerText = inputFieldValue; if (nodeInnerText != null && nodeInnerText != "") { rb.Checked = true; } } else if (con is EformCheckBox) { EformCheckBox cb = (EformCheckBox)con; string nodeInnerText = inputFieldValue; if (nodeInnerText != null && nodeInnerText != "") { cb.Checked = true; } } else if (con is EformSelect) { EformSelect temp = (EformSelect)con; temp.Text = inputFieldValue; } else if (con is EformCheckBoxList || con is EformRadioButtonList) { IEformInputField eFormControl = con as IEformInputField; eFormControl.Value = inputFieldValue; } } }