RadMaskedTextBox incorrectly hiding the value on ASYNC Postback

5 posts, 2 answers
  1. Karl
    Karl avatar
    8 posts
    Member since:
    Apr 2011

    Posted 15 Jun 2011 Link to this post

    I have a masked text box inside an update panel.  The masked text box has hideonblur set to true, and uses an empty message.  When the page loads, the masked text box displays the empty message correctly.  When I type a value in the masked text box, the empty message is correctly hidden.

    I then click a button.  The click event of this button is a trigger on the update panel that contains my masked text box.  The page is asynchronously posted back, and when it finishes, the masked text box now displays the empty message instead of the value that was entered!  If you click in the masked text box to give it focus, then tab out, the empty message is now hidden, and the value again displayed.

    How can I keep my masked text box inside the update panel and not have it incorrectly hide my value?  The only solution I've found is to remove the empty message AND hideonblur, which causes the mask to always display, which is not what I want.

    I am using the standard MS AJAX panels.  Any help is appreciated.
  2. Answer
    Martin
    Admin
    Martin avatar
    833 posts

    Posted 16 Jun 2011 Link to this post

    Hello Karl,

    We had been reported similar issue that was fixed in the Q1 2011 SP2 release (2011.1.519). Could you please verify whether the problem can be reproduced this version of the controls?

    Kind regards,
    Martin
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. Karl
    Karl avatar
    8 posts
    Member since:
    Apr 2011

    Posted 16 Jun 2011 Link to this post

    Martin,

    I was using version 2011.1.413.35.  I have upgraded to the latest version, and am now experiencing a different problem:

    Here is the code for my masked text box:

    <telerik:RadMaskedTextBox ID="myMask" runat="server" EnableEmbeddedSkins="False" Skin="HR" Mask="##:## <AM|PM>" HideOnBlur="True" Width="96px" EmptyMessage="00:00 AM or PM" SelectionOnFocus="SelectAll"></telerik:RadMaskedTextBox>

    In the prior version, this code was behaving as described above.  In the new version, the control doesn't correctly display the empty message when the page loads, rather, it shows the mask "__:__ AM."  The literals in the mask seem to be causing it to incorrectly deem the control as containing a value, thus displaying the mask rather than the empty message.

    So I am not able to test if the new version correctly stops the issue I was having, as the control isn't correctly hiding on blur to begin with.

    Any suggestions?
  4. Answer
    Martin
    Admin
    Martin avatar
    833 posts

    Posted 17 Jun 2011 Link to this post

    Hello Karl,

    Please note that in releases Q1 2011 SP2 (2011.1.519) and later when enumeration mask parts are used in the mask, the empty message will not be shown unless AllowEmptyEnumerations is set to true:

    <telerik:RadMaskedTextBox ID="myMask" runat="server" EnableEmbeddedSkins="False" AllowEmptyEnumerations="true"
        Skin="HR" Mask="##:## <AM|PM>" HideOnBlur="True" Width="96px" EmptyMessage="00:00 AM or PM"
        SelectionOnFocus="SelectAll">
    </telerik:RadMaskedTextBox>

    I hope this helps.

    Kind regards,
    Martin
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  5. Karl
    Karl avatar
    8 posts
    Member since:
    Apr 2011

    Posted 17 Jun 2011 Link to this post

    Martin,

    That did the trick.  The initial problem, and the problem caused by the upgrade are both solved.  Thank you for your help.

    Karl
Back to Top