Hello,
We are currently encountering a challenge in our project where we need to refresh the complete detail view for the Contact entity.
In our project, we have implemented custom ACL (Access Control Logic). All users have access to view all contacts, but some users, based on certain criteria, can only view (not edit) certain fields. These restricted fields are filtered out using OutputFilter on the backend and hidden in the frontend within the record/detail.js file using the hideField function.
When a user is unable to edit the entity due to restrictions, an "Unlock" button appears. Clicking this button adds the user to the unlockedByUsers field, which grants them access to view and edit all fields of that entity.
The issue arises after pressing the "Unlock" button — we need to refresh the entire view. On the backend, after the unlock action occurs, we attempt to refresh on the frontend with the following code:
However, this approach does not fully refresh the view; the hidden fields remain hidden (even though they are correctly fetched in the model), and the edit mode is not enabled as expected.
We attempted to manually manage this logic using showField, but this approach is not working.
Currently, our workaround is to use location.reload();, but we are eager to implement a more appropriate solution.
Could someone please assist us with potential solutions?
We are currently encountering a challenge in our project where we need to refresh the complete detail view for the Contact entity.
In our project, we have implemented custom ACL (Access Control Logic). All users have access to view all contacts, but some users, based on certain criteria, can only view (not edit) certain fields. These restricted fields are filtered out using OutputFilter on the backend and hidden in the frontend within the record/detail.js file using the hideField function.
When a user is unable to edit the entity due to restrictions, an "Unlock" button appears. Clicking this button adds the user to the unlockedByUsers field, which grants them access to view and edit all fields of that entity.
The issue arises after pressing the "Unlock" button — we need to refresh the entire view. On the backend, after the unlock action occurs, we attempt to refresh on the frontend with the following code:
PHP Code:
this.model.fetch();
this.reRender();
We attempted to manually manage this logic using showField, but this approach is not working.
Currently, our workaround is to use location.reload();, but we are eager to implement a more appropriate solution.
Could someone please assist us with potential solutions?
Comment