At this time, JSF has no good solution to this problem.
This means that even though dynamic elements can be created and added to a Web page during the run time, the Web page will not be refreshed automatically without interaction from the user.
So, how do you automatically update a Web page with dynamic elements?
Each time you save changes to your map file, you can automatically update Web pages saved from and therefore associated with that map file.
You can enable the Auto Save feature when you first save your Web page or when you change a saved Web page by selecting the Auto Save as Web page every time this map is saved check box in the Save as Web Page dialog box.
The workflow is, when the managed bean gets the notification that the server-side data has been changed, the is invoked and the data model is updated.
Figure 2 shows that this framework builds a bridge between the database and the "Bean parts." Any application wanting to monitor data changes on the server side or receive events from the server side can use this framework as a template.
Swing already provides a mature way to automatically update the GUI based solely on the internal data status, but JSF does not have good support for refreshing the GUI based on a request from the server side.
If you check the standard life cycle of JSF, you will find that the user normally needs to produce an event on the Web page (by clicking a button, for example) to invoke the GUI refresh.
Listing 1 shows how to register and de-register listeners to a class.
Using the methods outlined in Listing 1 through Listing 3, you establish a framework for a managed bean to monitor changes of the server-side data.
Note The map view on a Web page is not changed when you change the map view in the map file.