Developing a component frontend update function/Import with summary screen
From Joomla! Documentation
Articles in this Series
24 Import with summary screen
The previous step of this tutorial describes an import process that updates the database without feedback to the user about which records have been updated. In some cases you might want to have more control on this process, ranging from just displaying a summary of the updated records to an explicit acknowledgment for each intended change.
This step describes the simple case of displaying a page listing the changed records after the update. It is just an example for adding user validation to import functions.
24.2 The changes
Again, these files have been updated to reflect version info.
A button is added for selecting checked import.
The button displays a separate view page for handling the import. The page contains a button to select the import file to upload. Execute the import by clicking the 'Upload' button, or cancel by clicking 'Go Back'.
This layout contains the form with those buttons. The 'Upload' button submits the form and posts the import data to the server.
The view starts the layout template of the previous section, and also catches the posted data after clicking the 'Upload' button.
When posted data is received, it is imported into the database using the import_csv() and import_xls() methods, just like the controller did in the previous step 23.2.4 of this tutorial. In this step, however, these functions also create a table with the imported data which is then displayed in the current view.
24.3 Source files for this step
24.4 Testing the features of this step
- Perform the same test as in the previous section 23.4 of this tutorial.
- Verify that the table lists the changes from the uploaded import file.