Using multiple FormPanelFor raises error.

  1. #1

    Using multiple FormPanelFor raises error.

    I've 2 FormPanelFor definitions:

    ..
    .Items
    (
    x.FormPanelFor(m => m.SelectedSection).ID("selectedSection"),
    x.FormPanelFor(m => m.SelectedGroup).ID("selectedGroup")
    )
    And have model definitions:

        public class Model_Section
        {
            [Field(FieldLabel = "Section Name", AllowBlank = false)]
            public string Name { get; set; }
    
             .....
         }
    
        public class Model_Group
        {
            [Field(FieldLabel = "Group Name", AllowBlank = false)]
            public string Name { get; set; }
    
             .....
         }
    they both have "Name" property in common and as a result i got this error:

    A Control with an ID of "App.Name" has already been initialized. Please ensure that all Controls have a unique id.

    The following Control has the same ID as at least one other Control on the Page. All Controls must have a unique ID.

    *************************
    Control Details
    *************************

    ID: Name.
    ClientID: App.Name
    Type: TextField

    *************************
    Parent Control Details
    *************************

    ID: selectedGroup
    ClientID: App.selectedGroup
    Type: FormPanel


    how can i fix this?
  2. #2
    Thanks for the report, FormPanelFor should set prefix automatically for subitems (unfortunately, it doesn't do it)
    At this moment, I can suggest to set it manually
    Html.X().FormPanelFor(m => m.SelectedSection, htmlFieldName: "SelectedSection")
    We will fix it and the fix will be available in next release

Similar Threads

  1. Multiple Clicking on tree shows multiple items
    By yash.kapoor in forum 2.x Help
    Replies: 1
    Last Post: Oct 16, 2012, 7:44 AM
  2. [CLOSED] Multiple Grid Sorting Example Error
    By marco.morreale in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 19, 2012, 9:19 AM
  3. Replies: 6
    Last Post: Apr 05, 2012, 4:23 PM
  4. Replies: 0
    Last Post: Oct 27, 2011, 10:02 PM
  5. Replies: 4
    Last Post: Feb 03, 2009, 9:52 AM

Tags for this Thread

Posting Permissions