< Previous | Next >

Lesson 12: Embed the map locator handler in the application

Add a new portlet to the main portal.

Change the main portal

Add lines for the map portlet that are similar to the lines for the other three:

  1. In the Rich UI editor, open the MainHandler.egl file and click the Source tab.
  2. Immediately below the historyHandler declaration, add a similar declaration for mapHandler:
    mapHandler MapLocatorHandler{};
  3. Immediately below the historyPortlet declaration, add a similar declaration for mapPortlet:
    mapPortlet Portlet{children = [mapHandler.ui], 
    			title = "Map", canMove = FALSE, canMinimize = TRUE};
  4. In the start() function, below the existing calls to addPortlet(), add the new portlet to the portal:
    	mortgagePortal.addPortlet(mapPortlet, 2);
    In this case, you are adding the map portlet to the second, wider column.
  5. Save the file. If you see errors in your source file, compare your code to the file contents in Finished code for MainHandler.egl after Lesson 12.

Test the portal

Test the main portal to make sure that the new Map portlet is displayed and that all portlets work correctly.
  1. At the bottom of the editor, click Preview. EGL displays the main portal and the four subsidiary portlets.
  2. Calculate at least two different mortgages and search for mortgages in the Map portlet.
    The completed main portal.
  3. Close the file.

Lesson checkpoint

There were no new tasks in this lesson.

In the next lesson, you install Apache Tomcat on your system so that you can run your application on an application server.

< Previous | Next >

Feedback