Radnumeric issue when in RadTabstrip

3 posts, 0 answers
  1. Matthew Botting
    Matthew Botting avatar
    41 posts
    Member since:
    Apr 2005

    Posted 23 Jul 2013 Link to this post

    Hi Telerik,
    I have a rad numeric textbox sitting within a radtabstrip and multipage.
    The multipage is set to renderSelectedPageOnly and hence the tabstrip is set to autopostback.

    I have found an issue with this however.
    If I change the number in the numeric textbox and then switch tabs the new number is lost upon switching back to the original tab.
    Viewstate is of course enabled.
    If I alter the number, then move the focus to another element prior to switching tabs the change is retained.
    I find this to be a big problem and am currently looking at putting a handler to onclienttabselecting to rectify the issue.

    Note I have tested this same behaviour against a regular asp:textbox and the change is retained as I would expect.

    Regards,
    Matt
  2. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 26 Jul 2013 Link to this post

    Hello Matt,

    This happens because the RadNumericTextBox has more complex structure, and the value is not considered as set until an enter key is pressed or the control is blurred. The easier way to resolve the issue is to add client onclick on the tabs and focus some other element of the page, that will cause blur for the inputs and their values will be set.

    Regards,
    Vasil
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Matthew Botting
    Matthew Botting avatar
    41 posts
    Member since:
    Apr 2005

    Posted 29 Jul 2013 Link to this post

    Thanks Vasil,
    I do understand the complexity involved, however believe this to be a particularly nasty bug that could go unnoticed in testing and potentially cause data loss.

    I have written the following jQuery to select the first visible input button or textbox (that isn't a radnumeric) and have assigned it to OnClientMouseOver. This is not ideal as hovering over the tabstrip will move the focus to another control, however it appears to be too late to use onclienttabselecting as the incorrect behaviour occurs. I do not see a onclientclick in the API doco.

    I suppose that I could update the below function to then refocus the initial item
    function Unfocus(sender,args){
        $telerik.$("input[type=text]:visible:not(.riTextBox):first,input[type=button]:visible:first").focus();
    }

    I assume that this has been logged and may be looked at in a future hotfix, or do you require me to submit this via your issue tracking system?

    Regards,
    Matt
Back to Top