Announcement

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

    Manage a DynamicForm state

    Hey folks, I am enjoying to work with SmartGwt. However, I am a freshman in this field. Please, tell me if this make sense for you:

    Assuming that we need to create an elementary form to add/update data in an entity with four attributes, where two of them composes the key and need to be shown when we are updating the data, but not edited, only the other two. I was thinking that will be very useful to manage the form state (creating and editing mode), which allows we to perform some action accordingly with the state or the state change. Something like to enable or disable controls and so on.

    Have you any idea?

    The first thing that came into my mind was to extend DynamicForm and add the state attribute and create a callback handler invoker to allow the programmer to set something such as an event handler that would be called when the state change.

    Please, give me your two cents!!!!!!!! Any contribution will be very appreciated.

    Kind regards,

    Vitor Eduardo
    Last edited by vitor.eduardods; 17 Mar 2016, 05:14.

    #2
    Hi Vitor. Did you check the builtinds sample that comes with your SmartGWT distribution? I think it covers the use case you want.

    On the other hand, I don't think you need to extend DynamicForm. Just use its setCanEdit method. This can be invoked from a form button, to toggle the edit mode.

    Comment


      #3
      Hi Carlos, thank you so much for your reply.

      Well, about to use setCanEdit: I realized that this just switches the read-only status of the form items. I am looking for a more advanced feature. I would like to put on developers' hand the power to decide what happens when toggle the form state. For instance, could be appropriate put only some of the controls into read-only mode, or you need execute some command in addition.

      About the samples I will rummage again.

      Thank you once again.

      Best wishes

      Vitor Eduardo
      Last edited by vitor.eduardods; 17 Mar 2016, 06:29.

      Comment


        #4
        Well, setCanEdit can be also set a a FormField or FormItem level.

        Comment

        Working...
        X