In this step you will write the code to load task information into the data table on the view.
1. Switch to the Source tab of the view.
2. Before the End_Com command, paste in this method routine which clears the data table (#List) and calls the server modue to load data from the xTask table. Note that the server module name (here #TaskSRV) must match the name of the server module you created in Create the Server Module.
Mthroutine Name(Refresh) Access(*PRIVATE)
Define_Com
Class(#TaskSRV.Find) Name(#Find)
Clr_List Named(#List)
#Find.ExecuteAsync(
#List )
Endroutine
3. Then add this code to call the Refresh method when the Task view is about to be shown:
Evtroutine
Handling(#COM_OWNER.Prepare)
#COM_OWNER.Refresh
Endroutine
4. Scroll down to have a look at the Refresh method routine which calls the Find method in the server module to load data into the view.
5. Compile the view.
6. Now execute your web page and display the Task view to make sure data is loaded into the data table.