Dynamically add or remove rows in a visualforce table

Visualforce can be leveraged to implement user interfaces as per our requirements, many times we need solutions that are dynamic enough that would cater to our future needs. Here is a visualforce application that allows dynamic addition or removal of table rows. Example uses wrapper class in building the logic. Cross symbol and addition symbol are used to add or remove rows.



Visualforce Page



Apex Class

3 comments:

  1. The above code is not retriving the name of account , phone,email automatically on selection of account and giving error as follows

    System.ListException: DML statment found null SObject at position 0
    Error is in expression '{!Save}' in component in page dynamicaddingandremoving: Class.DynamicRow.Save: line 23, column 1

    Class.DynamicRow.Save: line 23, column 1

    ReplyDelete
  2. I got this error

    System.ListException: List index out of bounds: 3
    Error is in expression '{!Del}' in component in page addaccountrow: Class.MultiAdd.Del: line 55, column 1

    Class.MultiAdd.Del: line 55, column 1

    ReplyDelete