cancel
Showing results for 
Search instead for 
Did you mean: 

How to Refresh Table Data

Former Member
0 Kudos

Hi all,

I have the following scenario:

I call RFC to fill a table rows with data and for each row there is an approve button. when i click the button on the table it dispalys a popup confirmation dialog. Then, when I click OK, the row on the table should be removed from the table as the element has been approved. but in my case, the row is still there when i click OK on the confirmation popup.

so, how i can refresh the table with the latest data from the rfc?

appreciate your help!

thanks,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

use the below code to remove the selected element.


wdContext.node<Table Data Source Node Name>().removeElement(wdContext.node<Table Data Source Node Name>().get<Table Data Source Node Name>ElementAt(wdContext.node<Table Data Source Node Name>().getLeadSelection()));  

Regards,

Ramesh

Answers (5)

Answers (5)

gautam_singh
Participant
0 Kudos

Hi Rami,

To refresh table data you can do one more thing i.e. restart the application again and this will be achieved by using IWDPageService.

try {

IWDPageService pageService = (IWDPageService)WDPortalUtils.getService(WDPortalServiceType.PAGE_SERVICE);

pageService.restartApplication();

} catch (Exception e) {

// TODO: handle exception

wdComponentAPI.getMessageManager().reportException(e.getMessage(),true);

}

Former Member
0 Kudos

Hello

Before writing these 2 lines of code,

wdThis.wdTestCompController().executeRFC().

wdThis.wdTestCompController().populateDataFromBackend()

you can also invalidate the node.For that write the foll code

wdContext.wdTestCompController().invalidate();

These will help in refreshing the node. Write this piece of code before the 2 lines written above.

Thanks

V S Shetty

Former Member
0 Kudos

Hi,

On implementation of the action Ok, after the code written for approving the data , you need to call the method from component controller to execute the RFC again and then populate the table again. This will serve the purpose.

A fine approach will be :

Create a method (say X) which calls the method from component controller to execute the RFC and then populate the table node.

Call the above method(X) initially.

Also call the method()X after the data is approved that is in the implementation of the action OK.

Regards.

Rajat

Former Member
0 Kudos

Hi,

For example you have a method for rfc execute like executeRFC() and another method populateDataFromBackend() for populating backend data into the node binded to table.

After OK button click in the same event handler execute the RFC model again and populate the backend data into the node binded to table again as below.

wdThis.wdTestCompController().executeRFC()// I think already you are doing this.

wdThis.wdTestCompController().populateDataFromBackend()// this you need to invoke again

Regards,

Charan

Former Member
0 Kudos

After the confirmation dialog box coding in the onActionApprove method (which is called on click of approve button), you should write some code lines to remove the row from table (node element from table node).