TOC PREV NEXT INDEX



PDF
ICEfaces Online Reference




 


 




Adding New Properties


Each section in the map, and each check box, and each row in the bottom table, are populated by properties from a TimeZoneWrapper object. We will change TimeZoneWrapper.java to add the new properties that timezone.xhtml uses JSF expression language bindings to access:

1. Add new property to hold the relative file path to the map image for the time zone being represented by this TimeZoneWrapper:
private String imagePath;
 
2. Add another property for managing both the current state of the check box for this time zone, and the visibility of the corresponding row in the bottom table:
private boolean currentlyShowing;
 
3. Initialize the new properties:
/**
 
 * @param id id used to identify the time zone.
 
 * @param imgPath Path to the image to represent this time zone.
 
 * @param mapId map button component id in web page
 
 * @param checkId checkbox component id in web page
 
 */
 
public TimeZoneWrapper(String id, String imgPath, String mapId, String checkId)
 
{
 
		this.id = id;
 
		this.imagePath = imgPath;
 
		this.mapCommandButtonId = mapId;
 
		this.checkboxId = checkId;
 
		this.currentlyShowing = false;
 
		this.dateFormat = TimeZoneBean.buildDateFormatForTimeZone(
 
				TimeZone.getTimeZone(id) );
 
}
 

 
4. Add accessor methods for the new properties:
public String getImagePath() {
 
		return imagePath;
 
}
 
...
 
public boolean getCurrentlyShowing() {
 
		return currentlyShowing;
 
}
 
...
 
public void setCurrentlyShowing(boolean showing) {
 
		currentlyShowing = showing;
 
}
 


Copyright 2005-2006. ICEsoft Technologies, Inc.
http://www.icesoft.com

TOC PREV NEXT INDEX