Skip to Content

Add new row to a table after introducing new data in other view.

Hi experts,

I have a huge problem because I am not able to find data in order to do that.

This what I need to do:

I have a Table in the View ("view1) wich is displaying data from DataModel. Then I press a button which navigate to another view ("view2) where I have to add new data. Once I have added the data I press a button which call a event ("onAdd") in order to store the data using jQuery.sap.storage.Type.session. (I do this way because I don't want to create new data in the data model unless another confirm button had been pressed).


So now, I would like to know if its possible to add a new row in the table on the view (view1) displaying the new data when onAdd event (which is in the view2 controller) is triggered. When I go back to the view1 I should be able to see the new row with the new data added.


I don't know how to bind the action of a event in the view2 whose results have to be displayed in the view1 and where I have to write the code in order to add the row.



Thanks in advance,


Marcos.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 11, 2016 at 12:05 PM

    Hi Marcos,

    I'm afraid it's not possible to add a row in way you want.

    To add row you have to add the new entry to the data model underneath your table but as you described it's not possible due to your confirmation process.

    Maybe you can add a whole new 'columns' to your data model indicating the status of each entry so you can add the new entry with a status like 'pending' preventing your business logic to process the new one till it's status has been changed?

    Greetz,

    Silvio

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 11, 2016 at 04:18 PM

    just push an element to the array which is bound to the table. that's it.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.