cancel
Showing results for 
Search instead for 
Did you mean: 

Binding transfer problem

Angelo_Ab
Participant
0 Kudos
270

Hi,

I have a problem when trying to transfer binding from Action to Page.

When I click on object table row and afterwards navigate directly to a Page, all works fine, the fields on that page show the binding informations.

If i click on the same Object Table but i navigate on a Popup(choose an operation(buttons) that affects the target page) and from Popop to the Page, the Page does not receive the binding from the first action:

Object Table -> OnPress(NavToPopup) -> Press Button on Popup -> OnPress(Initialize and Fetch data) -> NavToShowSalesOrderPage

I tried to use rules in the OnPress event of Popup Buttons but I was unable to transfer the binding.

OnPress Event of Pupup Button(Initialize)

   let pageProxy = clientAPI.getPageProxy();

    clientAPI.showActivityIndicator(clientAPI.localizeText('Loading'));
    clientAPI.executeAction("/App/Actions/ClosePage.action");

    pageProxy.setActionBinding(pageProxy.getBindingObject());
     
    return clientAPI.executeAction("/App/Rules/CreateSalesOrder/FetchSalesOrder.js");
export default async function FetchSalesOrder(clientAPI) {

    let pageProxy = clientAPI.getPageProxy();

    //get action binding
    var binding = pageProxy.getActionBinding();

    //get client data
    let appClientData = pageProxy.getAppClientData(); 
    


....Fetch Operations...


clientAPI.dismissActivityIndicator();
return clientAPI.executeAction("/App/Actions/ShowSalesOrderActions/NavToShowSalesOrder.action"); }

How I can transfer the binding ?

Thank you.

View Entire Topic
bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Without the full project I can't say for sure why.  However, I did a test with the following setup.

Data Table -> OnPress -> Navigation Action -> Modal Page

On the Modal page I have a button and a Key Value control to confirm the default binding for the page is the selected row from the data table.  In the OnPress of the button I call the first rule 

Button -> OnPress -> Rule 1 -> SetActionBinding -> Rule 2 -> Navigation -> Detail Page

I checked via the debugger that in both Rule 1 and Rule 2 the ClientAPI.binding was still set to the selected Row from the Data Table.  On the Detail Page there are default bindings to the data from the selected row and they are populated as expected confirming the binding was passed from the Data Table row to the detail page.

Since there is stuff in your Rule 2 I don't see I can't say if that impacts anything or not but it looks like you should be good to go assuming your detail page is trying to bind to the row properties from the Data Table.

Angelo_Ab
Participant
0 Kudos

If I want to share the project it is possible through a SAP Incident Case ?

 

bill_froelich
Product and Topic Expert
Product and Topic Expert
Yes you can share the full project in a support case