cancel
Showing results for 
Search instead for 
Did you mean: 

create and edit table in ui5

f_cemunal
Participant
0 Kudos

Hello everyone,

i am trying to create a sapui5 application that generates an empty table and saves user input for later display.

i i have searched forum but couldnt find exactly what i am looking for.

any help would be appricated.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos
Sharathmg
Active Contributor
0 Kudos

You can generate the table using the Javascript code.

Then, link a local json model to the table. Ensure that the model is similar to the oData model structure.

Now, when you wish to save it to backend, map the values from local model to oData model and execute the service which will save it in backend.

Regards,

Sharath

f_cemunal
Participant
0 Kudos

Is there an example for that ? I am new to ui5 and i need to see a complete example to understand

Sharathmg
Active Contributor
0 Kudos

Check this blog for examples of the code using JS.

As a practice, define the table in the XML view and use the JS to bind the model.

Check link: https://sapui5.hana.ondemand.com/explored.html

or Blog for JS examples: https://blogs.sap.com/2015/06/13/ui5-programming-examples/

junwu
Active Contributor
0 Kudos

you can only do that with jsonmodel

Joseph_BERTHE
Active Contributor
0 Kudos

Hello,

Your first question is which model do you use ? Odata Model or JSon ? is your table connected ?

Then, you have to attach you table to your model. If it is JSon, then it will be a Javascript array manipulation. If it is ODataModel, you will have play with Odata API (setProperty and submitChange).

Regards

f_cemunal
Participant
0 Kudos

Hello Joseph,

i want to create table myself. At first table will have cells but will be empty, user will fill the table then save it.

I know how to create a table based on Odata but i need to know how to define a table myself and then populate it.

How can i do that ?

Thank you for your answer.