Announcement

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

    Form react to data change / cache update?

    How can I make my form "react" (I need to do something w/r to hiding and showing buttons) when the datasource data has changed as a result of a new fetch or from a cache update?

    Is there a particular handler that I can register to get a callback under these situations?

    I have lists and forms as well as tabs and I would like a change say from the listgrid that modifies the row to update my form with respect to the buttons I show. The data in the form is getting updated because of the same datasource but I need to react to the change because I may have to hide or show buttons as a result of the data.

    Thanks!

    #2
    Hi stonebranch1,

    please see ResultSet.addDataArrivedHandler(handler)

    Best regards,
    Blama

    Comment


      #3
      That is adding via the list grid correct?

      Is there a way to do that from my form(s) that use a ValuesManager?

      Comment


        #4
        Never tried, but there is also ResultSet DynamicForm.getResultSet().

        Comment


          #5
          I will give it a try.

          Thank You Kindly & much appreciated!

          Comment


            #6
            Unfortunately, that will not work in my case:

            [ERROR] - 12:09:15.073:XRP4:WARN:Log:getResultSet(): data is not a ResultSet; returning null (if grouped, use getOriginalResultSet(); if unbound, use getRecordList(); can only be called on DataBoundComponents after initial data has been fetched)

            Comment


              #7
              Has anyone else needed to do something like this?

              I would have thought others would have run into the situation where they need their form's to change (not just the data) when the datasource cache has been updated, and hence the need for a form or value manger handler that gets called when the data has been updated (non-user update) from fetch or update for example. The fetch or update would have originated from another UI component, not from the form in question.

              Comment


                #8
                You may be able to get by with just showIf or enableIf handlers, which are re-evaluated when a new set of values is provided.

                Otherwise, you can create a zero-length ResultSet (initialData as an empty array, initialLength 0) and it will fire DataChanged notifications when the DataSource is changed.

                Comment

                Working...
                X