Creating editable form table using Buffer Data Provider in VBCS (Part3)

 This is a continuation of previous blog.

  • Now we must add logic to Cancel and Apply button and make sure the user changes are being recorded and pushed into BDP.
  • Create a Boolean variable cancelEditVar and assign a default value as true to the same, this will later be user to record if the changes are to be discarded or pushed into BDP.

  • For Cancel button create an ojAction event and assign cancelEditVar to true and editRow to { rowKey: null }

  • Now for Apply button create an ojAction event and check to see if the form is valid and assign editRow to { rowKey: null } and assign cancelEditVar to false

  • Now create an ojBeforeRowEditEnd event for the table, modify the cancelEdit property to pick value form cancelEditVar

  • Create a new variable rowDataNew in ojBeforeRowEditEnd event and map the same to the variable rowData

  • Create 2 functions areDifferent and mutateBDP to check if there is any difference between the old data and user edited data and the second function to actually mutate BDP with the user entered data


  • In action check to see if the newly created row is same as the original row, if not mutate BDP to include the user modified row

  • Now run the application to see if user can edit the rows and the same is reflected in table



  • Now create below function to get all pending commit records from BDP

  • Create a dummy button on top of the page and execute below function and check the logs to see the pending changes



Comments

Popular posts from this blog

Mavenize an Oracle ADF Application

Creating Column Filter on a VBCS Table using ListDataProvider(LDP)

Using Custom Colors in Sunburst Chart