on 2022 Oct 27 2:46 PM
Hi,
When I update some data in the background then call a redraw() on the current mdk page to refresh the page, I noticed that only controls which have an EntitySet Target defined on those data get refreshed.
Other UI element based on a rule that gets the clientAPI.binding object do not get refreshed that way. They remain "bound" to the object entity they received when rendering the page the first time.
What am i doing wrong? How could I refresh this binding so that the UI elements are updated accordingly?
What would be the best practice to refresh all UI elements in that page?
Thanks
Hi,
I have issue setting the new updated entity to my pageProxy binding as you suggested.
pageProxy.binding = newUpdatedEntityObject; -> does not work
Based on documentation there is only a Getter (no Setter) for that binding property.
How can i bind that new object to my pageProxy?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pascal,
My apologies, I tested by modifying the property in the binding directly, assuming the binding itself is also modifiable.
In that case you can try Bill's suggestion or you will need to modify the property of the binding directly: e.g.
pageProxy.binding.ProductName = newUpdatedEntityObject.ProductName;
pageProxy.binding.ProductDescription = newUpdatedEntityObject.ProductDescription;
and so on.
Regards
Ming
Thanks Ming - this solves my issue. (Although I was trying to design a more "generic" approach to refreshing some pages using the same method)
For information - Bill's suggestion does not work in this scenario - unless I call a Navigation action on the same page after the pageProxy.setActionBinding(binding)
Regards
Hi Bill - Sorry I missed that last comment.
Actually the only "refreshed" UI elements when calling a redraw are the ones with a DataBound Container (for which you can specify a Design Target Entity.
If - for example - I have a Simple Button whose Title value depends on the bound entity then it will not be refreshed on redraw - which kinda makes sense as this button is not likely to be "re-rendered" when the bound entity changes.
Pascal
Thanks - indeed I'm not using MDK oData action.
I will update this binding manually as you suggested.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pascal
This will depends on how you update your data in the background. Typically, if you updated your data via one of the MDK OData actions, the refresh of the data in the page would have been taken care of automatically by the Data Subscription. This is assuming the entity you updated are related to the entity bound to your page. If it's not related, then you'd need to manually add custom DataSubscription on your page / sectioned table level to the specific EntitySet you are updating, that way when that entityset is updated, we'll redraw your page and refresh the binding accordingly.
But if you are not using MDK OData actions, thus can't make use of the Data Subscription, then you can also manually update your PageProxy's binding (because that's the binding of the page) before you call the redraw.
e.g.
pageProxy.binding = newUpdatedEntityObject;
pageProxy.redraw();
Regards
Ming
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
11 | |
10 | |
10 | |
10 | |
8 | |
7 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.