Announcement

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

    Select text in disabled TextItem

    Hi all,
    I have DynamicForm which contains some TextItem fields. Some from this input fields are disabled and I would like to select text (by mouse) in this disabled input fields.It is possible?
    I found that SelectItem contains attribute canSelectText but TextItem not.
    May by I overlook something.

    Thanks a lot.

    #2
    Nobody has the same problem?

    Comment


      #3
      Originally posted by jiri.ov
      Nobody has the same problem?
      I have same problem, but only in Firefox. Is it bug?

      I have TextItem in DynamicForm (with absolute layout and can select text=true), and if a set DynamicForm.isDisabled(true), than TextItem is disabled, but in Firefox not selectable.
      Last edited by vasatko; 17 Oct 2010, 09:20.

      Comment


        #4
        I have the same problem, a want to select and copy text from disabled items with 'Ctr+C' or 'right click' and 'Copy'. Did you find something?

        Originally posted by jiri.ov
        Hi all,
        I have DynamicForm which contains some TextItem fields. Some from this input fields are disabled and I would like to select text (by mouse) in this disabled input fields.It is possible?
        I found that SelectItem contains attribute canSelectText but TextItem not.
        May by I overlook something.

        Thanks a lot.

        Comment


          #5
          I need to do the same. Any solutions out there? Thanks!

          Comment


            #6
            If you use a TextItem but setCanEdit(false), the text is selectable and be can be copied and pasted.

            Comment


              #7
              Sorry. Forgot to mention that I'm using SmartGWT 2.5p. I don't see TextItem.setCanEdit(). Is there another way in 2.5p?

              Comment


                #8
                In older versions, you can using a non-disabled TextItem but adding a ChangeHandler than just cancel()s all changes. You can setTextBoxStyle("textItemDisabled") to still make the item appear disabled.

                Comment


                  #9
                  You could add a changeHandler which always cancels the change event.
                  Or you could set the item to be marked as disabled (which will give you disabled styling as well)

                  Comment


                    #10
                    Thanks! I added the ChangeHandler and set the TextBoxStyle to textItemDisabled. But when I clicked on the disabled TextItem, it looked like it would when a user edits it (i.e., no gray text). So I created a textItemDisabledFocus style using the textItemDisabled style and put it into my own css file.

                    Comment

                    Working...
                    X