Bug Report T261047
Visible to All Users

TokenBox - The selected tokens are not binding correctly from the passed model

created 10 years ago

[DevExpress Support Team: CLONED FROM T251274: TokenBox - Model binding does not work correctly after upgrading the project to version 15.1]
[DevExpress Support team: this comment was created from a creator's answer]
Working correctly Model of IEnumerable type when I submit the form control. But it does not work when I want to bind data Model of IEnumerable type.

Example Url : http://localhost:2799/V1514NotWork

I found viewdata used as a solution, but that it should be used in this way

Model:

C#
public class V1514NotWorkViewModel { public List<string> Data { get; set; } }

Controller:public ActionResult Index()
{ V1514NotWorkViewModel defaultViewModel = new V1514NotWorkViewModel(); defaultViewModel.Data = new List<string>(); defaultViewModel.Data.Add("Tag1"); defaultViewModel.Data.Add("Tag2"); defaultViewModel.Data.Add("Tag3"); defaultViewModel.Data.Add("Tag4"); defaultViewModel.Data.Add("Tag5"); ViewData["DataForTokenBox"] = string.Join(",", defaultViewModel); return View(defaultViewModel); }

View:

C#
@model DXWebApplicationTokenProblem.Models.V1514NotWorkViewModel @{ ViewBag.Title = "Index"; } <h2>Devexpress V.15.1 NotWork</h2> @using (Html.BeginForm("Submit", "V1514NotWork")) { @Html.DevExpress().TokenBoxFor(m => m.Data, settings => { settings.Properties.AllowCustomTokens = true; }).Bind(ViewData["DataForTokenBox"]).GetHtml() <br /> <input type="submit" value="Send"/> }
Comments (2)
Anthony (DevExpress Support) 10 years ago

    Hi Volkan,

    We need more time to research this issue.

    Anthony (DevExpress Support) 10 years ago

      I've reproduced this issue and forwarded it to our developers for further investigation. We will update this report once any news regarding this subject is available.

      Answers approved by DevExpress Support

      created 10 years ago (modified 10 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.

        Comments (1)

          I can't confirm that this is working - I'll open a ticket for it: https://www.devexpress.com/Support/Center/Question/Details/T272637

          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.