smartclient

DynamicForm.setDisabled(false) not working entirely


Let me start by saying I'm new to Isomorphic framework so be gentle.

I'm disabling "the form" when it's created. Then once a user clicks "the button" it should enable it. The issue I'm having is that it only enables the TextItems, not the Section headings or ButtonItems. What am I missing?

the form

isc.DynamicForm.create({
    ID: "formSelectedUser",
    width: 540,
    numCols: 4,
    disabled: true,
    fields: [
        {
            defaultValue: "General Information", type: "section", sectionExpanded: true,
            itemIds: ["tbFirstName", "tbLastName", "tbEmailAddress", "tbUserName", "tbParentClient"]
        },
        { name: "tbFirstName", type: "text", title: "First Name" },
        { name: "tbLastName", type: "text", title: "Last Name" },
        { name: "tbEmailAddress", type: "text", title: "Email Address" },
        { name: "tbUserName", type: "text", title: "Username" },
        { name: "tbParentClient", type: "select", title: "Parent Client", defaultValue: "N/A" },
        {
            defaultValue: "Password Information", type: "section", sectionExpanded: true,
            itemIds: ["tbCurrentPassword", "tbNewPasswordAttemptOne", "tbNewPasswordAttemptTwo", "btnUpdatePassword"]
        },
        { name: "tbNewPasswordAttemptOne", type: "password", title: "New Password" },
        { name: "tbNewPasswordAttemptTwo", type: "password", title: "Confirm Password" },
        { name: "tbCurrentPassword", type: "password", title: "Current Password" },
        { type: "SpacerItem", colSpan: 1 },
        {
            name: "btnUpdatePassword", type: "ButtonItem", title: "Update Password", width: 146, endRow: false, startRow: false, click: function () {
                console.log("user wants to change password..");
            }
        }
    ]
});

the button

isc.Button.create({
    name: "submit",
    type: "button",
    width: 140,
    title: "Submit",
    layoutAlign: "center",
    click: function () {
        formSelectedUser.setDisabled(false);
    }
});

Solution

  • Well, it seems a bug. Actually I've never used the setDisabled on a DynamicForm, usually I use setCanEdit which works also on sections and buttons. Could it work for your use case also?