As of the end of the previous lesson, the CalculationResultsHandler handler subscribes to a single event: mortgageApplication.mortgageCalculated. When that event occurs, the handler updates and re-displays the pie chart. However, the user might select a row in the history portlet and cause a different event to be published: mortgageApplication.mortgageResultSelected. If CalculationResultsHandler subscribes to that event, too, the handler can respond to the user's selection in the same way, by updating and re-displaying the pie chart.
The simplest way to subscribe to both events is to use the asterisk (*), which is a wildcard character that represents any event in a set of events. Do as follows:
InfoBus.subscribe("mortgageApplication.mortgageCalculated", displayChart);
InfoBus.subscribe("mortgageApplication.*", displayChart);
EGL now calls the displayChart function
whenever an event occurs if the name of the event begins with mortgageApplication..For the history portlet, add lines that are similar to the lines for the other two portlets:
historyHandler CalculationHistoryHandler{};
historyPortlet Portlet{children = [historyHandler.historyResults_ui],
title = "History", canMove = TRUE, canMinimize = TRUE};
mortgagePortal.addPortlet(historyPortlet, 1);
historyPortlet.minimize();
if(historyPortlet.isMinimized())
historyPortlet.restore();
end



In the next lesson, you add a portlet to display a map of mortgage companies that are in a specified area of the United States.