Data for a Scheduling Gantt Chart

28-16 Web User Interface Developers Guide for Oracle Application Development Framework The handleTaskSelected method is specified in a backing bean. Example 28–8 shows sample code for the backing bean. Example 28–8 Backing Bean for Handling Task Selection public void handleTaskSelectedTaskSelectionEvent evt { JUCtrlHierNodeBinding _task = JUCtrlHierNodeBindingevt.getTask; String _type = _task.getAttributeTaskType; RichPopup _popup = m_gantt.getFacetchartPopupMenu; if _popup = null { RichMenu _menu = RichMenu_popup.getChildren.get0; _menu.getChildren.clear; if Summary.equals_type { RichCommandMenuItem _item = new RichCommandMenuItem; _item.setIdi1; _item.setTextCustom Action 1; _menu.getChildren.add_item; } else if Normal.equals_type { RichCommandMenuItem _item = new RichCommandMenuItem; _item.setIdi1; _item.setTextCustom Action 2; _menu.getChildren.add_item; } } } For more information about using the af:popup components see Chapter 13, Using Popup Dialogs, Menus, and Windows .

28.7 Working with Gantt Chart Tasks and Resources

You can customize Gantt chart tasks to create a new task type, specify a custom data filter, and add a double-click event to a task bar.

28.7.1 How to Create a New Task Type

A task type is represented visually as a bar in the chart region of a Gantt chart. You can create a new task type in one of three ways: ■ Defining the task type style properties in the .jspx file or in a separate CSS file. ■ Defining a TaskbarFormat object and registering the object with the taskbarFormatManager. ■ Modifying the properties of a predefined task type by retrieving the associated TaskbarFormat object and updating its properties through a set method. The TaskBarFormat object exposes the following properties: ■ Fill color ■ Fill image pattern ■ Border color ■ Images used for a milestone task ■ Images used for the beginning and end of a summary task 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;