Hi Community,
As i am experimenting with using more web blocks, to reduce the amount of AOs, I had did the sample app as attached.
The expected results which i want, is that after i add new employees and i need to display the dashboard again, the new employee will be included. And it has been achieved. Eventually, i will be having more web blocks and more if/else statements in the widget tree.
Had follow the examples from the following,
I used a client variable to store a text data type, and in the if/else, i am doing something like. Yes i know, it's hard-coded. I welcome any suggestions to better handle this
My main question is, i am getting the following warning
Expected Aggregate Refresh: 'GetEmployeeById' aggregate uses AddEmployee block's input parameters, so it should be refreshed in the OnParametersChanged event handler of the block.
I can get rid of this warning by simply having a OnParametersChanged client action, then just refreshing the aggregate. Is this the correct way to do it, cause i couldn't understand the logic behind this.
Are there any better ways to improve on what i had done? Cause i have a button on the screen, to change the ViewStatus to edit, then in my other web block, after i save the new employee, i have as assign to set the ViewStatus to null again.
Thank you.
Hi @Jun Mun Chan ,
For that warning message, the answer would be YES, that is the correct way to do it.
The reason is that If the input of the block suddenly changed, it will not automatically refresh all the screen aggregates or data action. You can see more details here: https://success.outsystems.com/documentation/11/building_apps/application_logic/screen_and_block_lifecycle_events/ There should not be any effect on your AOs by doing this.
In your inquiry regarding the blocks, I am not a UI/UX expert, but your UI can improve if you do the adding of the user using a popup.
I have attached the updated OML with the popup implementation.
Another thing to note is that the remaining error is related to exposing the Create entity action in your client. You may create one Server Action that executes this entity action and then call that new server action in your client action.
Regards,
Bryan