Tuto WEBDEV 25
Part 1: Discovering WEBDEV 53 11. Validate the summary. The file description appears in the data model editor. 12. Save the analysis: click among the quick access buttons (or press Ctrl + S). 13. Close the data model editor. 14. A window is displayed, proposing to synchronize the project. It is used to check the differences between the created pages and the data defined in the analysis. This step is performed whenever the analysis is modified, when going back to the project pages. 15. Click "Yes". Let’s not spend more time on the data model editor. It will be presented in details in an another lesson. Saving data ▶ Let’s go back to the registration form in order to implement the addition of data typed by the Web user in the data file. The document bar is found at the bottom of editor. In this bar, a button is displayed for each document opened in the editor. • "P" represents the project. • "PAGE_Form" represents the "Form" page. ▶ We need a Button control to save the data from our form. This control will be used to validate the information entered in the page and to save the data in the Registration data file. ▶ To create a Button control: 1. On the "Creation" pane, in the "Usual controls" group, click . 2. The control currently created follows the mouse movement. 3. Click inside the page to create the control (below the edit controls for example). The control is created. 4. Press the space bar: the caption becomes editable. 5. Type "Save". 6. Press Enter to validate. ▶ To write the WLanguage code associated with the Button control: 1. Display the popup menu of the control and select "Code" (or press F2). 2. The events associated with the control are displayed. Yellow headers correspond to the events performed on the server, and green headers correspond to the events performed on the browser. 3. We want to save data in the database. The access to the database can be performed in Server code only: we must write the WLanguage code in the "Server click" event (yellow). 4. Write the following WLanguage code: PageToFile() HAdd(Registration) Info("Record successfully added.")
Made with FlippingBook
RkJQdWJsaXNoZXIy NDQ0OA==