on 09-02-2015 1:54 PM
Hi All,
I have a sap.ui.commons.TabStrip control on my view (defined in xml). If I change the content of a TextField on one tab and then change to an other tab and back, the content of the TextField is reset to the original value.
The TextField is bound to an ODataModel, and the binding mode is set to "two way".
Any idea why this is happening? How can I prevent it?
Best Regards,
Szilmér
Hey,
You did not call oData when you select a tab right ? Also, if you share your code it will be easier to understand what problem is.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Adem,
You are right. I have called bindElement on a control which contains my text field. This triggers the reload of the data from the server. The problem is, that i need this call, because the data shown on the two tabs are from two different entities (actually two subentities of a main entity). So when i change to the second tab, i need to load the data of the second entity from the server with bindElement.
Is there any other way to do this?
hey,
What i understand is, you want to need to load the data of the second entity from the server when clicked to second tab but you dont want to load the data of first view data.
did you try to use selectedIndex of tabstrip properties, this may help you to get which tab is clicked and create a condition to call a model or bind a element according to the selected tab.
Hey,
it's exactly what i'm doing. The data is not overwritten when i change to the second tab, because in this case i just load the data of the second entity.
It is overwritten when i change back to the first (assuming that i changed something on the first tab), because i call the bind element every time the tab is selected.
I solved the problem now by setting, and later checking a variable to see if a binding has already been done. In this case i don't call the bind element again when the tab is changed.
Thanks for the help!
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.