Edit a customer record
In this section, you learn how to create a form using the component.form to display the fields returned from the dynamic data provider. Add an action.submit-form with a method: update that saves the changes to the record in the dynamic data provider.
- Open the Hello- solution in in , right-click on the s node in Explorer, and select New file.
- Name the file edit-customer. Click on Default to open the skeleton YAML created by the .
- Give the a title called Edit customers and provide a description like Edit customer details.
- Delete the header and onfocus nodes.
- You are going to use the same datasource, query, form, and form fields that you used in the view-customer.jigx file. Use the code below.
- A submit-form action is used to save the data from the text boxes to the SQLite database. The submit form action will automatically match the instanceIds of the controls on the and use the update method to save the changes to the record in the local SQLite table with each instanceIds as a property for the JSON object in the Data column. Use the submit.form action code below:
2. Your edit-customer.jigx file should resemble the code below.