Editing Data in Tables, Trees, and Tree Tables

Using Tables and Trees 10-9 Tables and tree tables contain the bodyContextMenu facet. You can add a popup that contains a menu to this facet, and it will be displayed whenever a user clicks on the table, but not within a specific row. For more information about creating context menus, see Section 13.2, Declaratively Creating Popup Elements.

10.1.5 Accessing Client Table, Tree, and Tree Table Components

With ADF Faces, the contents of the table, tree, or tree table are rendered on the server. There may be cases when the client needs to access that content on the server, including: ■ Client-side application logic may need to read the row-specific component state. For example, in response to row selection changes, the application may want to update the disabled or visible state of other components in the page usually menu items or toolbar buttons. This logic may be dependent on row-specific metadata sent to the client using a stamped inputHidden component. In order to enable this, the application must be able to retrieve row-specific attribute values from stamped components. ■ Client-side application logic may need to modify row-specific component state. For example, clicking a stamped command link in a table row may update the state of other components in the same row. ■ The peer may need access to a component instance to implement event handling behavior for more information about peers, see Section 3.1, Introduction to Using ADF Faces Architecture . For example, in order to deliver a client-side action event in response to a mouse click, the AdfDhtmlCommandLinkPeer class needs a reference to the component instance which will serve as the event source. The component also holds on to relevant state, including client listeners as well as attributes that control event delivery behavior, such as disabled or partialSubmit. Because there is no client-side support for EL in the rich client framework RCF, nor is there support for sending entire table models to the client, the client-side code cannot rely on component stamping to access the value. Instead of reusing the same component instance on each row, a new JavaScript client component is created on each row assuming any component must be created at all for any of the rows. Therefore, to access row-specific data on the client, you need to use the stamped component itself to access the value. To do this without a client-side data model, you use a client-side selection change listener. For detailed instructions, see Section 10.10, Accessing Selected Values on the Client from Components That Use Stamping.

10.1.6 Geometry Management and Table, Tree, and Tree Table Components

By default, when tables, trees, and tree tables are placed in a component that stretches its children for example, a panelCollection component inside a panelStretchLayout component, the table, tree, or tree table will stretch to fill the existing space. However, in order for the columns to stretch to fit the table, you must specify a specific column to stretch to fill up any unused space, using the columnStretching attribute. Otherwise, the table will only stretch vertically to fit as many rows as possible. It will not stretch the columns, as shown in Figure 10–7 . 10-10 Web User Interface Developers Guide for Oracle Application Development Framework Figure 10–7 Table Stretches But Columns Do Not When placed in a component that does not stretch its children for example, in a panelCollection component inside a panelGroupLayout component set to vertical, by default, a table width is set to 300px, as shown in Figure 10–8 . Figure 10–8 Table Does Not Stretch When you place a table in a component that does not stretch its children, you can control the height of the table so that is never more than a specified number of rows, using the autoHeightRows attribute. When you set this attribute to a positive