I have multiple comboboxes and a "Add button" next to each combo box. User can type search term, select value and click on "Add button" for next step.
Combo1 - Add Button1
Combo2 - Add Button3
Combo3 - Add Button3
When user types search term in combo1 and selects a value and does not click on Button1 and goto 2nd drop down and search select and click on 2nd add button. Then click on 1st Add button, Combo1 looses its selected value i.e. get_selectedItem returns null.
Is it possibe for combo1 to retain its value?
Combo1 - Add Button1
Combo2 - Add Button3
Combo3 - Add Button3
When user types search term in combo1 and selects a value and does not click on Button1 and goto 2nd drop down and search select and click on 2nd add button. Then click on 1st Add button, Combo1 looses its selected value i.e. get_selectedItem returns null.
Is it possibe for combo1 to retain its value?
Thanks
Imtiaz
5 Answers, 1 is accepted
0
Hello Imtiaz ,
RadComboBox is supposed to retain its value, could you please try using get_selectedValue and let us know how it goes?
Greetings,
Yana
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
RadComboBox is supposed to retain its value, could you please try using get_selectedValue and let us know how it goes?
Greetings,
Yana
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Imtiaz
Top achievements
Rank 1
answered on 29 Dec 2008, 09:21 PM
comboBox.get_selectedItem() returns null
comboBox.get_selectedValue() return : Object doesn't support this property or method
However get_Value returns the selected Value
Below is the code sample
Since get_selectedItem is returning null, I am not able to call get_attributes()
Thanks
Imtiaz
comboBox.get_selectedValue() return : Object doesn't support this property or method
However get_Value returns the selected Value
Below is the code sample
var comboBox = $find(("<%=AssetCombo.ClientID%>")); |
if(comboBox!=null) |
{ |
//If nothing is selected then do nothing |
if( comboBox.get_selectedItem()==null) |
{ |
alert("Please select an asset to continue.."); |
window.event.cancelBubble=true; |
window.event.returnValue = false; |
return false; |
} |
if(comboBox.get_selectedItem().get_attributes().getAttribute("RestrictionEnforment")==1) |
{ |
.... |
} |
Since get_selectedItem is returning null, I am not able to call get_attributes()
Thanks
Imtiaz
0
Hi Imtiaz,
I am sorry for offering get_selectedValue, RadComboBox really doesn't support such method. You can use the value received from get_value() to find the selected item like this:
Hope this helps.
Best wishes,
Yana
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I am sorry for offering get_selectedValue, RadComboBox really doesn't support such method. You can use the value received from get_value() to find the selected item like this:
var val = comboBox.get_value(); |
var item = comboBox.findItemByValue(val); |
Hope this helps.
Best wishes,
Yana
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Imtiaz
Top achievements
Rank 1
answered on 30 Dec 2008, 10:28 PM
var val = comboBox.get_value(); returns value |
var item = comboBox.findItemByValue(val); |
returns 'null'
Looks like it is not maintaining state between postback.
Combo1 - Add Button1
Combo2 - Add Button3
Combo3 - Add Button3
I have all three comboboxes in update panel. When user clicks on add on any button ajax postbacks happens, and it is forgetting state of other combo boxes selection.
Thanks
Imtiaz
0
Hello Imtiaz,
We couldn't reproduce the problem locally. Please open a support ticket and send us a running example. Thanks.
Best wishes,
Albert
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
We couldn't reproduce the problem locally. Please open a support ticket and send us a running example. Thanks.
Best wishes,
Albert
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.