Announcement

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

    read-only formitems with readOnlyDisplay

    Hi,
    for a few week we're using smartclient version 9.0 and recently i've tried to
    use your new read only feature for the formItems. Sadly i've found a bug.
    I've created a form with three formItems, of the types text, boolean and date. The "readOnlyDisplay" attribute of each formItem was set to "static".
    If the Form is not editable from the begin, it's not possible to make the form editable again. The formItems remain as static text. You'll see the example code below

    Code:
    sc.DynamicForm.create(
      {
       "ID":"form",
       "autoFocus":true,
       "selectOnFocus":true,
       "canEdit":false,
       "fields":
       [
    	{"name":"textItem", "title":"Text", "type":"text", "readOnlyDisplay":"static"},
    	{"name":"checkBoxItem", "title":"Boolean", "type":"boolean", "readOnlyDisplay":"static"},
    	{"name":"dateItem", "title":"Date", "type":"date", "useTextField": true, "readOnlyDisplay":"static"},
       ],
       "values":
       {
    	"textItem":"Text",
    	"checkBoxItem": true,
    	"dateItem": new Date()
       }
      }
      );
      isc.Button.create(
      {
    	title: "change",
    	left: 10,
    	top: 200,
    	click: function() {console.log(form.canEdit);console.log(!form.canEdit); form.setCanEdit(!form.canEdit);form.markForRedraw();}
      });
    I've tested this with todays build of smartclient version 9.0

    Regards
    Marcus

    #2
    We've made a change to address this - please retest with a build dated September 13 or later.

    Note that you may also need to set readOnlyDisplay on the containing form.

    Comment


      #3
      The bug is fixed, thank you. But i just found the next one.

      If you apply the same settings as before, you'll see the result in the attached screenshot.

      It seems to me that the static text of the date and textItem is shifted higher of it's title
      Attached Files

      Comment


        #4
        This is a result of the specified height for the item exceeding the space required for the text. Explicitly setting the height to null will cause the item to size to its text (and center it as expected)

        Regards
        Isomorphic Software

        Comment


          #5
          It works, but not perfectly. If you take a closer look you'll see that the height of the value
          is still minimal above the title. But that's good enough for me. Thank you for your help

          Regards

          Comment


            #6
            Setting the height to null works for the most formItems but sadly not for every one of them.
            For selectItems it causes the picker to be partially shown, which does not look very appealing.
            In my opinion it's not a good solution, being forced to change the height of a selectItem everytime i change the canEdit attribute of it's form.

            Regards

            Comment


              #7
              Can you clarify what you're seeing with SelectItems in this mode? Expected behavior would be to not see the picker icon at all (not to see a partial icon). A screenshot or sample code might help.

              On the general question of having to change the height in readonly mode, it's not trivial to resolve this issue as there are cases where the height may have been explicitly specified / should be retained, but we'll consider whether we can somehow simplify the default behavior, and let you know if we come up with something

              Regards
              Isomorphic Software

              Comment


                #8
                A screenshot is attached and as you can see the picker item seems to be cut off at two points, so you can only see the middle of the picker icon.

                Regards
                Attached Files

                Comment


                  #9
                  Ah - we misunderstood and thought you were referring to an icon being displayed in while the item was in static, non-editable display mode. Are you seeing problems with the appearance while the item is read-only with "static" display?

                  Comment


                    #10
                    As a follow up - we are working on a solution to improve vertical-alignment behavior in static (read-only) mode without the need to modify the height attribute. We will follow up when we have more information

                    Regards
                    Isomorphic Software

                    Comment


                      #11
                      We've now made a change to address this.
                      Please try the next nightly build and let us know if you continue to see these alignment problems.

                      Note the change was the introduction of the applyHeightToTextBox / shouldApplyHeightToTextBox() APIs

                      Regards
                      Isomorphic Software

                      Comment

                      Working...
                      X