cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

MDK Code Not Working on Android Device - Unable to Redraw Sectioned Table

Sourabh1
Participant
0 Kudos
595

Hello SAP Community,

I'm currently working on an MDK (Mobile Development Kit) application and facing an issue with redrawing a sectioned table on an Android device. The code snippet I'm using is as follows:

let container2 = context.getPageProxy().getControl('SectionedTable0');
container2.redraw();

This code works perfectly on other platforms, but it doesn't seem to have any effect on my Android device. I've checked for errors in the console and ensured that all necessary permissions are set. Despite this, the section does not redraw as expected.

Here are some additional details:

  • MDK Version: 24.11.0
  • Android Version: 11

Steps I've taken so far:

  1. Verified the code works on other platforms.
  2. Checked for any console errors.
  3. Ensured all necessary permissions are granted.

Has anyone else encountered a similar issue or have any suggestions on how to resolve this? Any help would be greatly appreciated!

Thank you in advance!

Accepted Solutions (0)

Answers (2)

Answers (2)

EzraLiu
Discoverer
0 Kudos

Delete this one

Sourabh1
Participant
0 Kudos
what to delete.
bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

I am unable to reproduce this issue.  I created a section page with a key value section and object table and when I trigger my redraw by pressing the toolbar button it redraws and updates as expected.  Can you provide more context around the page you are trying to redraw and expectations?

Sourabh1
Participant
0 Kudos
Hi @bill_froelich the issue we face that we have created rule on page onload it works is to take data from API and save it in ClientData. This ClientData is used as target for data table to show data. My issue is that data is stored in ClientData but when use let container2 = context.getPageProxy().getControl('SectionedTable0'); container2.redraw(); it not updating the data table in android but in V24.11 is updating working fine. I also used let container2 = context.getPageProxy().getControl('SectionedTable0').getSection('SectionDataTable0'); container2.redraw(); this to redraw but still it not updating data in data table.
bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos
Instead of doing this in onLoad, I would suggest you use a rule for the Target of your data table that returns the result of your API call. If needed, you can still cache the result in Client Data and your rule can check first if cached data exists and return it or make the API call as needed.
Sourabh1
Participant
0 Kudos
Hi @bill_froelich, Thank you for the suggestion. Could you please provide an example of a rule for using the target of a data table? Additionally, which target should I choose: string target or function call target? Thanks for your help!
bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos
You would use a String Target pointed to your rule that returns the array of data to display.