Announcement

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

    DynamicForm: how to make single fields editable on mouse over?

    I'm wondering if there's a well known way to show a readonly dynamicform (i.e. it uses only StaticTextItem fields, not readonly TextItem ones) and provide a way to editing only one single field per time (i.e. clicking on a button shown only on mouse over, etc).

    It would be similar to the way JIRA 6 let you edit fields:

    Every field edit should be considered atomic, hence saved.

    I'm going to make it myself from the ground up, replacing a single StaticTextItem with the editable item on the fly, but I'd like to be sure there's no other easy way to achieve it.
    Attached Files

    #2
    You haven't mentioned your version - if its 4.0 or 4.1, you can do this easily, because these newer releases no longer generate StaticTextItems for readOnly formItems.

    Instead, they use readOnlyDisplay appearances to represent canEdit: false items in a number of ways (one of "static", "readOnly", "disabled") - so you would just setCanEdit(false) on all fields and then setCanEdit(true) on a specific one when your button is clicked.

    If you're using an older version, you'll need to do something like you suggest - generally, creating all the items (both static and otherwise) and then using showIf/show/hide to manipulate them is probably the best approach.

    Comment


      #3
      Great!

      Great!
      And sorry, you are right: I missed to report that I'm using SmartGWT 4.0. I'm going to update to the latest nightly in order to get the fixes you mentioned at http://forums.smartclient.com/showthread.php?t=27810

      Originally posted by Isomorphic View Post
      You haven't mentioned your version - if its 4.0 or 4.1, you can do this easily, because these newer releases no longer generate StaticTextItems for readOnly formItems.

      Instead, they use readOnlyDisplay appearances to represent canEdit: false items in a number of ways (one of "static", "readOnly", "disabled") - so you would just setCanEdit(false) on all fields and then setCanEdit(true) on a specific one when your button is clicked.

      If you're using an older version, you'll need to do something like you suggest - generally, creating all the items (both static and otherwise) and then using showIf/show/hide to manipulate them is probably the best approach.

      Comment

      Working...
      X