Bug Report T291501
Visible to All Users

ASPxTokenBox has incorrect values if TextField contains special characters

created 9 years ago

Hello support,

ASPxTokenBox saves text value instead of integer when the text value contains a space (two words or more).

Related support ticket T209510 claims there is a solution from 15.1.3 and beyond but I'm able to reproduce the bug every time.

Here is what my HTML looks like:
<dx:ASPxTokenBox Width="600px" ID="Cats" runat="server" DataSourceID="dsCategories" ValueSeparator="," TextField="Category" ValueField="LiveCourseCategoryId" AllowCustomTokens="False" ShowShadow="True" />

When saving to my database my column looks like:

1,2,5,Vestibular and Balance, 4,hokey pokey, 7, etc…

This is fairly critical, please help!

Thank you,

Nick

Comments (3)
Nastya (DevExpress Support) 9 years ago

    Hello Nick,
    I tested the project from the T209510: ASPxTokenBox has incorrect values if TextField contains several spaces ticket in the 15.1.6 version, but did not succeed in reproducing the issue (see the attached screencast). Would you please clarify whether your scenario is different and modify the project accordingly to demonstrate the issue?
    I'm looking forward to your reply.

      Found the problem.  Your token box does not like \r or \n (possibly other special characters).
      Take your example and change a user to:  new User {UserID = 2, UserName = "Vestibular\r\n&\r\nBalance"},
      I solved it by cleaning up the SQL data but now you know stripping out those special characters fixed the problem.  I'm sure there are other special characters that might be throwing things off too.  It was hard to track down because when I look at the Item collection of the token box, the value was numeric.
      So I suspect that TokenBox.Value.ToString() has the bug in it.
      Hope that helps!
      Nick

      Nastya (DevExpress Support) 9 years ago

        Hi Nick,
        Thank you for the additional information. I managed to reproduce the issue with the \r character. So, I forwarded this ticket to our developers for further research. We will contact you as soon as we have any results.

        Answers approved by DevExpress Support

        created 9 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.