Visual Builder

Get Involved. Join the Conversation.

Topic

    Yogesh Krishnaswamy
    Refreshing Table dataAnswered
    Topic posted October 23, 2019 by Yogesh KrishnaswamyGreen Ribbon: 100+ Points 
    71 Views, 6 Comments
    Title:
    Refreshing Table data
    Summary:
    Refresh button isn't working for ADP
    Content:

    Hi All,
    We are facing an issue with VBCS refresh button for a Business object.

    We have developed an application which will get the data from Business object and display on the application. Later we have kept the update status drop down for every record as per the requirement. The Submit button calls an OIC REST API which will update the status of the record in the back end system and deletes the record from BO.

    After deleting the record, the refresh button we put on the application to display the updated data from BO isn't working. The button is being added with a event where the getall api is called first and then fire data provider event is used .But if we refresh the whole application through browser ,its displaying the updated data from BO.

    Version:
    Version: 19.3.1.2
    Image:

    Best Comment

    Shay Shmeltzer

    Can you show us what's in your assign variable action?

    What do you assign to what? 

    Do you see that assignment happening if you look at the browser log console?

    Comment

     

    • Duncan Mills

      See this article to understand what the refresh event actually does - hint - it's not what you are trying to use it for:

      https://blogs.oracle.com/groundside/adventures-in-mutation-adding-rows-to-a-table-or-listview-in-oracle-visual-builder

      If you are using an Array Data Provider you will need to re-populate the underlying data array yourself 

      • Yogesh Krishnaswamy

        Hi Mills,

        Thanks for the response.Can you please brief the sentence "If you are using an Array Data Provider you will need to re-populate the underlying data array yourself ".

        Are you asking me to assign the variable bound to table after the call to endpoint. If so, I have already tried it but did not work.

    • Duncan Mills

      What I mean is that you should update the underlying array that is the data attribute of the Array Data Provider.  e.g. Extract the data attribute from the ADP (which will be an array of the relevant type). make the changes that you need to that array - e.g. add, delete or update rows.  The assign the updated array back to the ADP data attribute using the assign variable action. 

      The change to the ADP will then automatically trigger any table or listview bound to it to refresh (or you can use the refresh data provider event at this point because you have actually refreshed the data with something new) 

    • Yogesh Krishnaswamy

      Hi Mills,

      I tried the same method that you have told in the latest comment but, its still not working for my application.Please find the image attached and guide me if I am going wrong anywhere.

      Regards,

      Yogesh.

      • Shay Shmeltzer

        Can you show us what's in your assign variable action?

        What do you assign to what? 

        Do you see that assignment happening if you look at the browser log console?

        • Yogesh Krishnaswamy

          Hi Shay,

          Thanks for the reply.

          After making the call to update API I am again making the call to getAll API and assigning the response to ADP that is bound to the table.Please find the image of assignment.

          I don't see any assignment happening in the browser console.

          Regards,

          Yogesh.