Declined
Last Updated: 05 Nov 2014 14:32 by ADMIN
ADMIN
Hristo Valyavicharski
Created on: 30 Apr 2014 15:21
Category: ComboBox
Type: Feature Request
1
FIX: get_value() method doesn't work correctly when "Native" render mode is set.

		
3 comments
ADMIN
Peter Filipov
Posted on: 05 Nov 2014 14:32
Hello, 

This is caused by the order of which the events are fired. E.g.:

         <asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="SelectTest"
                EnableClientScript="true"
                ErrorMessage="Custom Validator" ClientValidationFunction="testValidation"></asp:CustomValidator>

            <select runat="server" id="SelectTest">
                <option value="0">Value 0</option>
                <option value="1">Value 1</option>
                <option value="2">Value 2</option>
            </select>

        function testValidation() {
            console.log("validation");
        }

        $(document).ready(function () {
            $("#SelectTest").bind("change", function () {
                console.log("selected index has been changed");
            });
        });


With the above code you will notice that the validation is fired before the 'change' event which we handle internally in our control.

To overcome that behavior in your sample you should get the new value directly from the select element:
$telerik.$(combo.get_element()).find("select").val().

Keep in mind that after the validation event the value of the RadComboBox is properly returned by the get_value() property. 

Regards,
Peter
Ricard Bertran Vall
Posted on: 16 Jul 2014 08:57
Is there any scheduled date to solve this problem? 
Thanks
Ricard Bertran Vall
Posted on: 22 May 2014 14:53
In RenderMode="Classic" everything works fine and as expected! whereas in  RenderMode="Native" it doesn't at all.
n my scenario, I have a custom validator on each of my RadComboBoxes to verify user input. When user selects an item, CustomValidator verifies user selection is appropiate for him.
However, I've realized that RadComboBox SelectedValue has not the current value yet. It has previous value, actually.