Hey,
I'm trying to remove an aggregation binding of a table, because I want to set another one on it.
I need something like this:
if ( mytable.isBound())
mytable.unbindRows()
mytable.bindRows()
... but istBound() returns always "false", although it is bound and data are shown. The new binding is working well, but I think the old Binding remains at the model -> which causes (old) requests on a refresh.
What is generally the correct way to call ".bindRows()" many times, without getting too many old requests?
Or how can I remove a Binding totally from my model?
Thanks and greetings,
Joerg
Request clarification before answering.
isBound(sName) takes sName as parameter. I think you need to check table.isBound('rows').
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jörg,
it seems you have to use the setModel() method also for removing a binding.
Take a look at the documentation.
setModel(oModel, sName?) : sap.ui.base.ManagedObject
Sets or unsets a model for the given model name for this ManagedObject.
The sName must either be undefined (or omitted) or a non-empty string. When the name is omitted, the default model is set/unset.
So, this call should remove the previously bound model:
myTable.setModel();
Greets,
ben
Hi, if you know your model's array structure (like the array name, that contains all the JSON which is binded to the table), you can make such another Model, keep the same structure(just the array name, no need for JSON data).
Now, to remove the old binding, you can just set this empty Model to your Table, using the setModel() method.
In this way, your old binding will be removed completely.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I cannot understand that each "bindRows" generates such binding garbage at the model.
I think it must be possible to the change a binding (f.e. new filters), without generating a new one.
My task is to display content in a table, which depents on the selected line of a list ....
so I call every row selection change of the list table.bindRows() with filters from the list.
At the end I have as many XHR requests as row selection changes of the list, if I refresh the model.
... there must be a right/better solution for this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
... something like oDataMoel.updateBindings() is exactly what I'm looking for, but does not work for me - all previous bindings remain at the model.
If I remove the model by "setModel()", the table inherits the model from its parent, which is the same model.
I think I need a redefinition of the binding.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
May be you can try this ..
Step 1: mytable.unbindRows()
Step 2: oDataModel.updateBindings(true)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.