Announcement

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

    Disabled DF with properties: copy text

    Hi Isomorphic,

    is it possible to have "disabled DynamicForm", but that the user can select and copy text?

    Code:
                DynamicForm dF = new DynamicForm() {
                    {
                        setCanEdit(false);
                        setDataSource("animals");
                        setReadOnlyDisplay(ReadOnlyDisplayAppearance.DISABLED);
                        setCanSelectText(true);
    
                        TextItem ti = new TextItem("commonName");
                        setFields(ti);
    
                        fetchData(new AdvancedCriteria(new Criterion("commonName", OperatorId.STARTS_WITH, "El")));
                    }
                };
    Although I use "setCanSelectText(true)", I can't select and copy the text. That's first DF on this foto:
    Click image for larger version  Name:	canCopyText.PNG Views:	2 Size:	7.1 KB ID:	255279


    For other two cases with the same properties, I can select and copy text but I can't use those two cases in my app.

    If I use "ReadOnlyDisplay:READONLY", then it looks that user can edit forms and because I have a lot of forms, that would be confuzing for users. So I can't use this solution.

    If I use "ReadOnlyDisplay:STATIC",that's also bad solution because forms should always look the same, when user can or can not edit it. And if I use FormItemIcon, the position of it changes:
    Click image for larger version  Name:	dfs_app.PNG Views:	1 Size:	23.5 KB ID:	255283
    (Left is STATIC, right is DISABLED)
    This is bug definitly but not important for me.
    I just need that with "ReadOnlyDisplay:DISABLED" and "CanSelectText:true" user can select and copy the text.

    Best regards
    Pavo
    Attached Files
    Last edited by pavo123; 27 Sep 2018, 02:08.

    #2
    We’re just matching behaviors and appearances that are standard across browsers here. If you don’t like those standard behaviors, probably your best choice is to re-style the readOnly appearance so it’s slightly lighter. But just a note that this may cause users to expect the standard “disabled” behavior and not try to interact with the control at all, since disabled controls normally disallow interactivity entirely.

    Comment


      #3
      Hi Isomorphic,

      some customers are requiring to copy text from "disabled DF", so that's not a problem.
      How to re-style the readOnly appearance?

      If I use "READONLY" then it's not clear which DF you can edit or not.

      Click image for larger version

Name:	canEditOrNot.PNG
Views:	51
Size:	3.5 KB
ID:	255300

      In my app, I have a lot of DFs in the same Layout. Depending on some conditions, customer can sometimes edit some DF and sometimes not, so I have to use "ReadOnlyDisplay:DISABLED" to be perfectly clear which DF user can edit or not.
      Or I can use as you said "ReadOnlyDisplay:READONLY" but that needs to look the same as "ReadOnlyDisplay:DISABLED".

      Best regards
      Pavo

      Comment


        #4
        So again, you trying to change appearance that are standardized across browsers. That's fine, you can do that if you like. How styling is accomplished for FormItems is already well-documented - go ahead and take a look, especially at the *Style() properties and the FormItemBaseStyle overview.

        Comment

        Working...
        X