Tuto WEBDEV 25

Part 5: Let’s continue the development 195 Optimizing the page display By default, during the click on the "Find" button, the entire page content is returned by the server. To optimize the page display, you have the ability to enable the Ajax mode on this button. In our example, only the content of Table control will be returned by the server. Remark WEBDEV proposes several methods for using the Ajax technology in a site: • Ajax in one click : simply click in the code editor to transform an event into Ajax event. • Ajax controls (Table control, Looper control). The Ajax controls are used to display data dynamically loaded from the server. No need to download everything at once! • Ajax by programming via specific WLanguage functions: AJAXExecute and AJAXExecuteAsynchronous . ▶ To implement the Ajax mode on the "Find" button: 1. Select the "Find" button and display its events (F2). 2.  In the "Click (server)" button event, the AJAX link appears to be struck out in the code bar. 3. Click the AJAX link: the "AJAX enabled" link appears, indicating that the event is automatically changed into an Ajax event. 4. Close the code editor. ▶ Run the page test: 1. Click among the quick access buttons. 2. Define the different search parameters: • Customer name, • Status, • Payment mode, • Amount. 3. Click "Find". Only the content of the Table control is re-displayed.

RkJQdWJsaXNoZXIy NDQ0OA==