How to Customize a Gantt Chart Legend

Using ADF Gantt Chart Components 28-17 For tasks that have more than one bar, such as a split or recurring task, properties are defined for each individual bar. Example 28–9 shows sample code to define the properties for a custom task type in the .jspx file. Example 28–9 Sample Code to Define Custom Task Type Properties af:document f:facet name=metaContainer f:verbatim [CDATA[ style type=textcss .onhold { background-image:urlimagesBar_Image.png; background-repeat:repeat-x; height:13px; border:solid 1px 000000; } style ]] f:verbatim f:facet shows sample code to define a TaskbarFormat object fill and border color and register the object with the taskbarFormatManager. Example 28–10 Custom TaskbarFormat Object Registered with TaskbarFormat Manager TaskbarFormat _custom = new TaskbarFormatTask on hold, null, onhold, null; _gantt.getTaskbarFormatManager.registerTaskbarFormatFormatId, _ custom; TaskbarFormat _custom = new TaskbarFormatTask on hold, FF00FF, null, 00FFDD, 13; _gantt.getTaskbarFormatManager.registerTaskbarFormatFormatId, _custom;

28.7.2 How to Specify Custom Data Filters

You can change the display of data in a Gantt chart using a data filter dropdown list on the toolbar. Gantt charts manage all predefined and user-specified data filters using a FilterManager. Filter objects contain information including: ■ A unique ID for the filter ■ The label to display for the filter in the dropdown list ■ An optional JavaScript method to invoke when the filter is selected You can define your own filter by creating a filter object and then registering the object using the addFilter method on the FilterManager. Example 28–11 shows sample code for registering a Resource filter object with the FilterManager. Example 28–11 Custom Filter Object Registered with FilterManager FilterManager _manager = m_gantt.getFilterManager; ID for filter display label javascript callback optional _manager.addFilternew FilterRESOURCE_FILTER, Resource..., showResourceDialog; 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}