Uncheck Include in navigation. We don't want this page to appear in the application navigation.
Click the Save button.
Now it is time to load the product that the user will edit. We will use a route parameter called Id to get the current product.
Open the Edit Product page for editing.
Click on an empty space in the design canvas to show the Page Events.
Add a new handler of the Load event.
Set Type to Invoke data source method.
Set Name to getProductById.
Add a new Parameter.
Set Name to ID.
Set Value to ${parameters.Id}.
Add a new Then handler.
Set Type to Set property.
Set Name to product.
Set Value to ${result}.
This sequence will load the product by invoking the getProductById method and store the result in the product page property.
We will use that property to data-bind the edit form.
We are ready to add the edit form.
Drag and drop a Form component.
Set Data to product. This will data-bind the form to the product page property.
Click Auto generate. This will add a form field for every property of product property.
Scroll to the ID field and remove it. We don't want our users to update the ID property.
We have to handle the Submit event of the form in order to persist the changes.
Click Events in the property grid.
Add a new event handler of the Submit event.
Set Type to Invoke data source method.
Set Name to updateProduct.
Add a new Parameter.
Set Name to ID.
Set Value to ${parameters.Id}.
Add a second Parameter.
Set Name to Product.
Set Value to ${event}. The form component provides the user input as an event argument of the Submit event.
Add a new Then handler. It will execute if updateProduct is successful.