Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SympleType and textArea

    SmartClient Version: SNAPSHOT_v13.1d_2024-11-06/AllModules Development Only (built 2024-11-06)

    Hello, in my application I'm trying to use a SimpleType (which has editorType="TextItem") in a form with a field of type textArea, but I noticed that it uses the editorType defined in the SimpleType instead of textArea.

    I just want to check with you if it's expected and so if I've got to define a specific SimpleType for textArea.

    test case:

    Code:
    isc.SimpleType.create({
        name: "myText",
        inheritsFrom: "text", editorType: "TextItem"
    
    });
    
    isc.DataSource.create({
        ID: "myDS",
        fields: [{name: "aName", type: "myText"}]
    })
    
    isc.DynamicForm.create({
        ID: "form0",
        dataSource: "myDS",
        fields: [
            {name: "aName", type: "textArea", title: "foo"}
        ]
    })

    #2
    Hi Claudio
    The "type" property for a field is really a data-type for the field.
    In this case you define a field in a dataSource with type set to a custom SimpleType.
    Then when you bind a component to that dataSource, the field in question will pick up all those data type default properties, including "editorType".
    You can override the editorType at the item level, but the shorthand way of specifying an editor by setting type to the camelCase version of the item you want won't work.

    Try this instead:

    Code:
    isc.SimpleType.create({
        name: "myText",
        inheritsFrom: "text",
        editorType: "TextItem"
    });
    isc.DataSource.create({
        ID: "myDS",
        fields: [
            {name: "aName", type: "myText"}
        ]
    });
    
    isc.DynamicForm.create({
        ID: "form0",
        dataSource: "myDS",
        fields: [
            {name: "aName", editorType: "TextAreaItem", title: "foo"}
        ]
    })

    Comment


      #3
      Dead simple, but I didn't think of it. Thanks for the heads-up!

      Comment

      Working...
      X