Announcement

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

    Can Binary FormItems Have canEdit Set to False?

    Hello,

    We have a DynamicForm with one field that is type binary and used to upload a file. The upload works as expected. The issue we have is that they form is to be disabled until the user selects a 'New' button, which then enables the form with form.setCanEdit(true). This throws an error this.canvas.items is undefined in the devConsole and the form will not become enabled. If I simply remove the binary field from the form's field list then everything works fine, so its that field that is causing problems.

    Rather than creating a test case from scratch, I went to your showcase example to see if the same would happen there. It is experiencing the same problem. The showcase link I'm modifying is:

    https://www.smartclient.com/smartcli...tomBinaryField

    I have attached the modified JS which just defaults the form with canEdit as false and then calls form.setCanEdit(true) when pressing the upload button. You'll see that the ID field becomes editable while the binary field does not. Is this expected behavior or am I doing something wrong?

    Please let me know if you need anything else from me.

    Thanks,

    Jason
    Attached Files

    #2
    After more experimenting, the binary field will become enabled if you call setCanEdit(true) on the formitem itself rather than the entire DynamicForm.

    Comment


      #3
      We're not seeing a crash in the devConsole - but we do see the failure to enable a FileItem when setCanEdit() is called on it's form, rather than the item itself.

      You didn't mention your version, but we've added a fix to 12.1 and 13.0 which you can try out in builds dated March 6 and later.
      Last edited by Isomorphic; 5 Mar 2021, 03:11.

      Comment


        #4
        Thanks!

        Comment

        Working...
        X