Announcement

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

    canEdit =false but still field is editable after upgrading smartclient from V8.3 to V12.0

    I have around 100 dialog all over the project, and I have noticed after I have upgraded smartclient to 12.0 all of the unEditable fields which have canEdit=false is editable (But still disabled and you cannot change the value) but it looks like you are allowed to edit the field. Please take a look at the attached screenshot. As the screen shot displays that there are two highlighted fields that they should not be editable and as you see the "Description" field's value is too long in which they should just be a text, so because of that users cannot read the whole sentence.


    ----Note: I have instead used "StaticTextItem" for a few of them, and that has now displayed the uneditable fields correctly. Should I include this as a fix to all the uneditable fields please? Or this is something I can still use canEdit=false in the next release?

    Click image for larger version  Name:	CanEdit.PNG Views:	1 Size:	45.1 KB ID:	257481
    Starts
    16 Apr 2019
    Ends
    16 Apr 2019
    Last edited by shwanm; 16 Apr 2019, 13:20.

    #2
    See dynamicForm.readOnlyDisplay - you can change, on the whole form or on an item-by-item basis, what display to use. The display you're looking at is the readOnly appearance - a standard browser feature, and useful for displaying a value non-editable, in a fixed area, with the ability to copy and paste from the field.

    Comment


      #3
      Thank you for your response. What I have before was working before the upgrade from 8.3 ro 12.0 SmartClient. I have already used (canEdit: true, showReadOnlyDialog: true, readOnly :true).

      - I also looked into dynamicForm.readOnlyDisplay but still is not working for me.

      - The only thing that is working for is (editorType: "StaticTextItem" ), so if I do not have any other options, I then need to use this instead of (canEdit: true, showReadOnlyDialog: true, readOnly :true).

      - Can you please take a look at the attach screenshot? The first and second are still disabled editable, but I need to make them to be just a displayed text as seen below the first two fields.

      Click image for larger version

Name:	CanEdit.PNG
Views:	214
Size:	53.4 KB
ID:	257525

      Comment


        #4
        readOnlyDisplay is the correct property, but you repeatedly refer to "showReadOnlyDialog" which is a non-existent property. You are probably just typo'ing the property name. If you need to convince yourself that this property works as described, just try using it in any of the Feature Explorer samples that involve forms.

        Comment


          #5
          - I tried "readOnlyDisplay:" and the way it works now is like (readOnlyDisplay: "static"). I first thought I should have it like (readOnlyDisplay: true) that is why it was not working for me in the beginning. Can you please correct me if this (readOnlyDisplay: "static") is the correct way I should use?

          - So what is the difference between using readOnlyDisplay: "static" AND editorType: "StaticTextItem" please because they do both work the same for me?

          - A quick note I have no idea why is that the case after I upgrade the smartclient from 8.3 to 12.0 I used to just have (canEdit: false) and that was enough and did not need readOnlyDisplay in order to show it like a text. Any idea please?

          Comment


            #6
            Hi,

            just see the docs and possible values for ReadOnlyDisplayAppearance. This is all about what happens when a DF is not editable.

            StaticTextItem is also not editable, even if the form is. More like a Label from the DB inside the DF.

            Best regards
            Blama

            Comment


              #7
              And w.r.t the version difference. Perhaps (I don't know that) the default changed, as new options were introduced.
              If so, just use setDefaultProperties() (or the SmartClient equivalent) to change this for all instances of DF in your application.

              Isomorphic: Having a look at the source of setDefaultProperties(), what is the easy way to do this in SmartClient?

              Best regards
              Blama

              Comment


                #8
                8.3 is quite an old version and didn't support readOnlyDisplay - in such versions, if you set canEdit:false, you would get a staticTextItem - in more modern versions, canEdit: false will show the item styled according to the readOnlyDisplay.

                Blama - isc.FormItem.addProperties({ readOnlyDisplay: "static" }) would change the global default in SmartClient.
                Last edited by Isomorphic; 24 Apr 2019, 00:08.

                Comment

                Working...
                X