Displaying dropdown list inputs on a DataTable

I’m having issues with taking inputs from two dropdown lists and displaying these inputs in a table. The workflow is as follows:

  • User picks an option from the first dropdown list A
  • Dropdown list A enables dropdown list B
  • User picks an option from dropdown list B
  • Dropdown list B enables the “Next” button
  • When the user hits the “Next” button, the two inputs are saved into a dataframe and are displayed as a row of a DataTable.
  • Dropdown lists are cleared for the new selection

I tried to append a dataframe and pass this dataframe to a datatable every time a new selection is made.

One of the errors I got is:

Cannot read property 'forEach' of null

If I define the dataframe as a global dataframe, it will give me an error that says I used the dataframe before “assignment”.

And if I define the dataframe inside an app.callback then it will overwrite the dataframe and the DataTable will display one set of selection (will delete the old selection).