The official release of Ext.NET Mobile is now available. Ext.NET Mobile is an ASP.NET component framework for building Phone and Tablet specific mobile web applications. Read More

After Migration its not working-Combobox.

  1. #1

    After Migration its not working-Combobox.

    Hi All,
    in Ext 2.5 version below code works fine but in latest version (4.5.1) its not working. Its very difficult to manage the ID's. Because same reference model is used while submitting the request to database.
           X.ComboBox()
                .CellCls("contact-fieldleft")
                .ID("Userbase.CommunicationPreference.Id") //Problem is here
                .FieldLabel("Communication Preference<span class='red'>*</span>")
                .InputWidth(inputFieldWidth).Width(cellWidth)
                .Editable(true)
                .ForceSelection(true)
                .TypeAhead(false)
                .AllowBlank(false)
                .QueryMode(DataLoadMode.Local)
                .TriggerAction(TriggerAction.All)
                .EmptyText("-- Select Communication Preference --")
                .ValueField("id")
                .DisplayField("name")
                 .Store(X.Store()
                .AutoLoad(true)
                .Model(X.Model()
                .IDProperty("Id")
                .Fields(
                new ModelField("id", ModelFieldType.String) { Mapping = "Id" },
                new ModelField("name", ModelFieldType.String) { Mapping = "Name" }
                )).BuildProxy("~/DataCache/GetAllCommunicationPreferenceAjaxData/")
  2. #2
    Hello @MOHAMMEDRAFI!

    I don't quite understand your question, the way IDs are defined didn't really change from Ext.NET 2.5 to 4.5.1. What error message(s) are you getting? Is there a way we could reproduce the same issue you are getting on our side, so we could better advise on how to handle it?
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Getting Below error if we assign ID with dot to any EXT.net Control in MVC 4
    Reproducing this below issue is so simple create combobox by giving dot as ID. E.g. "Userbase.Address.Id" run this code on chrome with simple MVC application we will get below Error.
    Note: In our entire application we are assigning ID as mentioned below due to model structure.
    X.ComboBox()
               .ID("Userbase.Address.Id")
    
    Error at browser:
    
    ext.axd:2069 Uncaught Error: Invalid component "id": "Userbase.Address.Id"
        at new Ext.Error (ext.axd:2029)
        at Function.raise (ext.axd:2069)
        at Object.Ext.raise (ext.axd:2091)
        at constructor (ext.axd:44107)
        at new constructor (ext.axd:8354)
        at Object.widget (ext.axd:9559)
        at constructor.create (ext.axd:17033)
        at constructor.lookupComponent (ext.axd:94736)
        at constructor.prepareItems (ext.axd:95157)
        at constructor.add (ext.axd:94347)
    Last edited by MOHAMMEDRAFI; May 10, 2018 at 8:35 AM.
  4. #4
    Hello @MOHHAMEDRAFI!

    Thanks, I see the problem is the dot in the IDs. And that's indeed intriguing it worked for you in 2.x. Anyway, that could have worked in your scenario in version 2 and broken afterwards, but that's not been supported by Ext.NET since version 1. In fact, see this forum thread post by Geoffrey McGill back in Ext.NET v1.

    The thread itself is related to IDs with hyphens but then it is stated that only alphanumeric and underscore characters are supported within ASP.NET IDs. I'd say your scenario worked "by luck" in Ext.NET v2, and you should really switch the dots by upper camel case or underscores.

    But this is not an Ext.NET limitation due to ASP.NET alone. I see that the underlying framework, ExtJS also does not support this, and it is expressly documented in the Ext.Component.id definition, where it reads: "Valid identifiers start with a letter or underscore and are followed by (optional) additional letters, underscores, digits or hyphens.". Thus, the same ASP.NET limitation applies to ExtJS IDs, there's really very little we can do to support this.

    As your scenario worked back in v2, you probably didn't use the components' aspects that would otherwise break that, by chance.

    In summary, there are technical limitations why periods are not allowed on IDs. Hope you understand.
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Hello again, just an addition to what was said above.

    The writing of the 'id' documentation changed between versions, if you look at the Ext.AbstractComponent.id documentation (which was its location as of ExtJS 4, bound to Ext.NET 2.x), the statement "softens" to

    "id should be composed of only alphanumeric characters, dashes, and underscores. Characters outside of (a-zA-Z0-9_-) have the potential to cause parsing errors."
    So then, it was potential they would break. By that time, it was already not supported by Ext.NET, but was not enforced by either, as it worked for you.

    It happened that the acceptable character range was tightened from Ext JS v4 to v5 and/or v6, thus followed on to Ext.NET v3 and v4.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 1
    Last Post: Jan 02, 2013, 6:52 PM
  2. [CLOSED] Combobox with autoload migration from 1.0 to 2.0
    By blueworld in forum 2.x Premium Help
    Replies: 6
    Last Post: Oct 09, 2012, 2:25 PM
  3. ext.net control not working in IE9(combobox)
    By eldhose in forum 1.x Help
    Replies: 1
    Last Post: Apr 28, 2011, 5:45 PM
  4. Replies: 2
    Last Post: Feb 21, 2011, 5:22 AM
  5. ComboBox - Set Value not working
    By Tbaseflug in forum 1.x Help
    Replies: 3
    Last Post: Nov 19, 2009, 2:55 PM

Posting Permissions