Search code examples
sapui5

Refresh SimpleForm after Update, NOT entire model


I need to refresh a SimpleForm after I've done an update to a different entityset later in the user journey (the backend does several updates, one of which updates a UserStatus which is stored against the binding in the form).

I do NOT want to refresh the entire model (this.getModel().refresh()). Looking for something similar to updating a table binding (table.getBinding("items").refresh()).

Or to put another way, how do I refresh a simpleform, who's context is bound to a single GET_ENTITY result without refreshing the entire model?


Solution

  • SimpleForms in UI5 do not have any kind of aggregation binding like a Table or a List have, as they only serve as containers for your Input/Display controls. You could try to make a function that updates the bindings of the controls inside your Form if that suits you. If that's not possible, I suggest adding a GET_ENTITY Call function into your Frontend and bind your SimpleForm to it's result, so that you can call it again on demand.