Hi folks,
I hope that somebody already had a similar requirement and can provide some valuable hints in order to achieve an asynchronous rendering of table views like it is done with shortcuts in SAP-Note 1968050.
Requirement:
I want to render the data for a table view by using an AJAX callback (in order to decrease performance lacks).
Steps:
- Creating the BSP element (CL_CHTMLB_CONFIG_CELLERATOR) with the factory method in the HTML
- Saving the element in the controller class of the view as global attribute
- Render the element (No data was retrieved yet)
- Creating an AJAX callback to call the view's controller class
- Fetch the request with interface IF_CRM_WEB_CALLBACK~HANDLE_REQUEST
Now I have access to the BSP element I've saved in the controller class. In order to get the correct instance of the controller class, a modification in method IF_HTTP_EXTENSION~HANDLE_REQUEST of class CL_CRM_WEB_UTILITY was required. In method HANDLE_REQUEST I retrieve the data. Now I want to get the HTML code by using the method IF_BSP_BEE~RENDER_TO_STRING of the BSP element and send it back with a server response. Unfortunately, this method throws an exception because there's no request instance.
Further approach:
In order to retrieve the HTML code I've implemented a method that is similar to the method GET_ROW_HTML_FROM_AJAX_AREA from class CL_THTMLB_CELLERATOR that is used for additional rendering during scrolling events. Now, I was able to get the HTML code. But the response with the code has still no effect on client side.
Do you have any suggestions to achieve this requirement?
Thanks a lot in advance for your feedback.
Cheers,
Sebastian