cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 TabStrip - Changed data is reseted on tab change

xyla
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

xyla
Participant
0 Kudos

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?

Former Member
0 Kudos

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.

santhu_gowdaz
Active Contributor
0 Kudos

may you are binding both with same reference model. Use different reference names for your models.

xyla
Participant
0 Kudos

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!

Answers (0)