Hello,
I am working on an interface screen, that contains several card elements, each element will be displayed to the user depending on a certain condition. In each element, I need to call a method with sending "id" as a parameter and the method will return a value that I want to display.
Based on the above, I need a way to call the server action dynamically and display its value on the client.
Hi Kawthar,
Without Data Action(Fetch Data from another source) you can not call server action. You can use Block for card elements.
For parameter, You can create input parameter in block and you can use in data action.
Please find the attached sample using block.
Thanks
Vinod
Hi Ebrahim,
Certainly, you can construct a Data Action (Fetch Data from Another Source) and utilize the local variable to reflect the current selected id inside the data action, and then refresh the data action on demand.
see the below image for your reference..
Thanks @Mayank Dharmpurikar, but I have multiple cards elements each has a different id. For each of them, I want to set a different value for the local variable. how can I achieve that? My second question is whether using the data action from the client will refresh it? or I should call if from the server
When someone clicks on a card item, for example, if you have a container inside the card, you must trigger the click event of the container and provide the clicked card Id to the Event handler, which will then update the local variable and refresh the data action.
Yes, you can refresh the Aggregates and data actions from the client actions (Screen actions).