I have a standard tabular form with the add, delete, submit buttons. Now when we hit the Add button, it creates a new row in the form. I had a requirement such that the user selects a row using the standard checkbox and then when he hits add, it should create a new row, and also, copy the contents of the selected row to the new row.
Yes this is possible, but not by using build-in Apex, you can do this using jQuery. I can't write the code here withouth seeing your page but in short:
- Replace the function addRow on your add button to a function created by you
- At the start of that function write addRow();
- write a jQuery selector in the function to get the selected checkbox
- Now use traversing to get the values of all the item columns of that row
- then write those values in your last row using selectors and traversing again
Thanks. I am not familiar with JQuery, is there some link where such a logic is implemented? Atleast a basic one of adding a new row, and traversing and capturing the values? In forms we could do it using cursor but not sure how to do it in Apex.
In my case the requirement is straightforward. If there is a table with three rows and have a standard form in APEX with the add, delete and submit buttons along with the radio checkbox in a tabular form,
If I select a row and then hit the add button, a new row should be added and the values of the previous row should be passed.
Would you be having a link to any such demo or documentation on how this is done, would be very helpful.