How to generate a row on click of a button

Hi All,

I am developing a web application where I am using a modal. Inside that modal I am having a container where I have the two below fields :

Now under that I have a link with 'Add another Outcome'. When user will be clicking the link the above two fields should appear again like below :


How to achieve this thing ? and with that every record filled up by the user should get stored to the DB. 

Hi Suprio,

Take a structure of two fields and after that by default get this structure on action or preparation.

you get this two field and after that click on add button append two elements in same structure and use list append for that and use ajax refresh. you will get another two fields.

Hope this will help you.


Rahul Sahu

HI Suprio,

You might be using any structure or entity to load this form so what you have to do is create a list of that entity or structure as your local variable. Initially add an empty record in that entity and bind it to a list widget which will have your form.

On click event of "Add Another Outcome" button add another black entry in the list so it will automatically create another entry in your form.