Skip to Content

Passing value from simpleform to oData SAP UI5

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jun 22, 2017 at 01:13 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

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

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 05, 2017 at 04:42 AM

    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

    Add comment
    10|10000 characters needed characters exceeded