You need to sign in to do that
Don't have an account?
Chanagan Sakulteera
How to copy data from previous row when trying to add new row in visualforce page ?
Hi all, I'm new to salesforce
I have question regarding visualforce page. When I try to add a new row in visualforce page , I want to copy the data form previous row to new row as well how would I do that ? Any suggustion, I would really appreciate.
Thank you
Looks like you have a list of records or a list of wrapper classes, which is great. Your Add Row (commandButton) should call an action in your extension/controller that reads from the last row in your list, then creates a new instance of the object or wrapper or whatever is in your list, and then populates it. This action should return a null page reference, and then the command button should rerender your table to show the new row.
All Answers
Looks like you have a list of records or a list of wrapper classes, which is great. Your Add Row (commandButton) should call an action in your extension/controller that reads from the last row in your list, then creates a new instance of the object or wrapper or whatever is in your list, and then populates it. This action should return a null page reference, and then the command button should rerender your table to show the new row.