all good.
but, i have a PK which i also need to extract from the combo and i dont want this to appear in the combo text. so, i used the client side set_value function to store but when i get client side there is no sign of this. i'm not even sure where i'm supposed to collect it from since there is no "value" for the combo, only selectedvalue.
i suppose i could store the information in a hidden field but i would prefer the more elegant solution of extracting it from the combo.
can you help with that.
thanks,
rob
5 Answers, 1 is accepted
Would you please go into some more details on what exactly you are up to? Is it that you need to set the value at the client-side, fire a postback and then obtain the selected value at the client?
Regards,
Nick
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
hi nick,
here is the client side code i am using:
$find("<%= RadComboBox1.ClientID %>").set_text(valueStringBuilder.join(""));
$find("<%= RadComboBox1.ClientID %>").set_value(args.getDataKeyValue("eListRef"));
document.getElementById("<%= emailFrom.ClientID %>").value = args.getDataKeyValue("eFromName") + " <" + args.getDataKeyValue("eFromEmail") + ">";
document.getElementById("<%= listRef.ClientID %>").value = args.getDataKeyValue("eListRef");
the last line is storing the selected "eListRef" into a textbox because the second line, which does a "set_value" does not appear to persist to the server side. when i process the form after postback, i can only find the Text of the RadComboBox1, i can't find the "value" as set by the "set_value" statement above.
thanks,
rob
You should call the trackChanges() and commitChanges() methods of the combobox object to persist the changes at the server-side. Attached, please find a small and running project on the matter. Download the files and give them a go.
I hope this will get you started.
Regards,
Nick
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
function onRowSelected(sender, args)
{
var valueStringBuilder = [
args.getDataKeyValue(
"eType"),
": ", args.getDataKeyValue("eName"),
" (", args.getDataKeyValue("eCount"), " recipients)"
];
var combo = $find("<%= RadComboBox1.ClientID %>")
combo.trackChanges();
combo.set_text(valueStringBuilder.join(
""));
combo.set_value(args.getDataKeyValue(
"eListRef"));
combo.commitChanges();
document.getElementById(
"<%= emailFrom.ClientID %>").value = args.getDataKeyValue("eFromName") + " <" + args.getDataKeyValue("eFromEmail") + ">";
document.getElementById(
"<%= listRef.ClientID %>").value = args.getDataKeyValue("eListRef");
}
Check which version of the dll you are using. I had a number of issues with the combobox value with 12/18/07 (and earlier) version. One of the issues I had, which sounds similar to yours, was I was setting the value, but was not able to retrieve it on the server side code, or the client side code for that matter. I could only retrieve the text of the combobox. I got a hot fix for this in January, which later was part of the 1/15/08 release. This fixed my issue.
I noticed that your post was originally from 1/13/08, which is before the latest release that had the fix for the combobox value issues.
Just my 2 cents worth.
Jeff