cancel
Showing results for 
Search instead for 
Did you mean: 

Passing value from simpleform to oData SAP UI5

Former Member
0 Kudos
1,407

Hi All,

I am stuck at a point in my development. I have created a table and called a 'simpleform' on click of a button. Now if I make some changes in my simpleform, these changes do not reflect back to my table. In debug mode, I can see that the values are set at my simpleform level, but they do not pass back to the table level. I have tried to refresh my oModel, but it is not working. I am using here one-way binding. Should I use two-way binding for such scenarios ?

Also, is there any other way to achieve this functionality ?

Thanks

Meenakshi

Former Member
0 Kudos

I just tried by changing the default binding to TWO WAY binding, but still the CHANGED DATA is not reflected back. Please suggest a way in this scenario.

stefan_nasshan
Active Participant
0 Kudos

Maybe you can provide some snippix, that would make it easier to find possible issues.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member484715
Contributor
0 Kudos

Hi Meenakshi Raina,

You can either use two way binding in your form fields, or you can update the data in the table at the blur event of your input fields in the form.

Regards,

Arjun Biswas

former_member484715
Contributor
0 Kudos

Hi Meenakshi Raina,

You can either use two way binding in your form fields, or you can update the data in the table at the blur event of your input fields in the form.

Regards,

Arjun Biswas

Sharathmg
Active Contributor
0 Kudos

Firstly, the same object variable - should be linked to table column cell and the form input field which you are using.

If it is same object variable then it should reflect the same.

Refreshing the model is not necessary.

Debug steps:

1. Check if the data entered in simple form is updated in the model.

2. If yes, check in the table if the model value updated is appearing.

3. If no, there is problem with model bound to your simple form.

Regards,

Sharath

Former Member
0 Kudos

Hi Sharath,

Thanks for your reply. The data entered in my simpleform is not updated in my model. I tried using sap.ui.getCore().setModel(oModel);

But it is not working. I have attached some part of my code. Please guide me in what I am doing wrong.

Thanks

Meenakshi capture.txt

Sharathmg
Active Contributor
0 Kudos

I find something incorrect in the following lines in the simple form.

You seem to be getting a value and set it in the form combo box. You have not found the model to form as done in the table. So, the value set in the form is not bound to the model variable. Bind it to model variable and test it. Else, manually set the value of the model variable with the value selected by the user.

Note: check the console error while doing the change.

			var cBox = this.getValue("C_KFP_ECC_STATUS");
			sap.ui.getCore().byId("C_KFP_ECC_STATUS").setValue(cBox);
			C_KFP_ECC_STATUS = this.getValue("C_KFP_ECC_STATUS");
			sap.ui.getCore().byId("C_KFP_ECC_STATUS").setValue(C_KFP_ECC_STATUS);