on 2017 Jun 22 11:18 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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);
User | Count |
---|---|
62 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.