Customizing Gantt Chart Toolbars

28-18 Web User Interface Developers Guide for Oracle Application Development Framework When the user selects a filter, a FilterEvent is sent to the registered FilterListener responsible for performing the filter logic. The filterListener attribute on the Gantt chart component is used to register the listener. When implemented by the application, the data model is updated and the Gantt chart component displays the filtered result. Example 28–12 shows sample code for a FilterListener. Example 28–12 FilterListener for Custom Filter public void handleFilterFilterEvent event { String _type = event.getType; if FilterEvent.ALL_TASKS.equals_type { update the gantt model as appropriate } } To specify a custom data filter: 1. In the Structure window, right-click the Gantt chart node and choose Go to Properties . 2. In the Behavior category of the Property Inspector, in the FilterListener field, enter a method reference to the FilterListener you defined. For example, {project.handleFilter}.

28.7.3 How to Add a Double-Click Event to a Task Bar

Gantt chart components support a double-click event on a task bar. For example, you may want to display detailed information about a task in a popup window. Figure 28–8 shows a project Gantt chart with a double-click event on a task bar. Figure 28–8 Task Bar with Double-Click Event Example 28–13 show sample code for adding a double-click event to a task bar. Example 28–13 Sample Code for Double-Click Event dvt:projectGantt id=projectGanttDoubleClick startTime=2008-04-01 endTime=2008-09-30 value={projectGanttDoubleClick.model} Using ADF Gantt Chart Components 28-19 var=task doubleClickListener={projectGanttDoubleClick.handleDoubleClick} dvt:projectGantt Implement the handleDoubleClick method in a backing bean, for example: public void handleDoubleClickDoubleClick event

28.8 Specifying Nonworking Days, Read-Only Features, and Time Axes

You can customize a Gantt chart to display nonworking days of the week, turn off user interaction features, and specify the time axes.

28.8.1 Identifying Nonworking Days in a Gantt Chart

You can specify nonworking days in a Gantt chart. By default, nonworking days are shaded gray, but you can select a custom color to be used for nonworking days.

28.8.1.1 How to Specify Weekdays as Nonworking Days

If certain weekdays are always nonworking days, then you can indicate the days of the week that fall in this category. To identify weekdays as nonworking days: 1. In the Structure window, right-click a Gantt chart node and choose Go to Properties. 2. In the Appearance category of the Property Inspector, in the NonWorkingDaysOfWeek field, enter the string of days that you want to identify as nonworking days for each week. For example, to specify that Saturday and Sunday are nonworking days, enter the following string: sat sun. Alternatively, you can create a method in a backing bean to programmatically identify the nonworking days. For example, if you put the code in a backing bean in a method called getNonWorkingDaysOfWeek, then the setting for the nonWorkingDaysOfWeek attribute becomes: {myBackingBean.nonWorkingDays}. Example 28–14 shows sample code in a backing bean. Example 28–14 Backing Bean to Identify Nonworking Days public int[] getNonWorkingDaysOfWeek { if locale == Locale.EN_US return new int[] {Calendar.SATURDAY, Calendar.SUNDAY}; else ....... } 3. Optionally, specify a custom color in the NonWorkingDaysColor field. The value you enter for this attribute must be a hexadecimal color string.

28.8.1.2 How to Identify Specific Dates as Nonworking Days

You can enter specific dates as nonworking days in a Gantt chart when individual weekdays are not sufficient.