Skip to Content
0

Passing value from simpleform to oData SAP UI5

Jun 22, 2017 at 10:18 AM

177

avatar image

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

10 |10000 characters needed characters left characters exceeded

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.

0
Former Member

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

0
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Sharath M G Jun 22, 2017 at 01:13 PM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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

capture.txt (3.1 kB)
0

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);
0
Arjun Biswas Dec 05, 2017 at 04:40 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Arjun Biswas Dec 05, 2017 at 04:42 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded