Content Delivery Introduction to Tables, Trees, and Tree Tables

Using Tables and Trees 10-7 The currently active row is determined by the activeRowKey attribute on the table. By default, the value of this attribute is the first visible row of the table. When the table or tree or tree table is refreshed, that component scrolls to bring the active row into view, if it is not already visible. When the user clicks on a row to edit its contents, that row becomes the active row. When you allow only a single row or node to be edited, the table or tree or tree table performs PPR when the user moves from one row or node to the next, thereby submitting the data and validating that data one row at a time. When you allow all rows to be edited, data is submitted whenever there is an event that causes PPR to typically occur, for example scrolling beyond the currently displayed rows or nodes. Not all editable components make sense to be displayed in a click-to-edit mode. For example, those that display multiple lines of HTML input elements may not be good candidates. These components include: ■ SelectManyCheckbox ■ SelectManyListBox ■ SelectOneListBox ■ SelectOneRadio ■ SelectManyShuttle

10.1.4 Using Popup Dialogs in Tables, Trees, and Tree Tables

You can configure your table, tree, or tree table so that popup dialogs will be displayed based on a user’s actions. For example, you can configure a popup dialog to display some data from the selected row when the user hovers the mouse over a cell or node. You can also create popup context menus for when a user right-clicks a row in a table or tree table, or a node in a tree. Additionally, for tables and tree tables, you can create a context menu for when a user right-clicks anywhere within the table, but not on a specific row. Tables, trees, and tree tables all contain the contextMenu facet. You place your popup context menu within this facet, and the associated menu will be displayed when the user right-clicks a row. When the context menu is being fetched on the server, the Note: You should not use more than one editable component in a column. Performance Tip: For increased performance during both rendering and postback, you should configure your table to allow editing only to a single row. When you elect to allow only a single row to be edited at a time, the page will be displayed more quickly, as output components tend to generate less HTML than input components. Additionally, client components are not created for the read-only rows. Because the table or tree, or tree table performs PPR as the user moves from one row to the next, only that row’s data is submitted, resulting in better performance than a table that allows all cells to be edited, which submits all the data for all the rows in the table at the same time. Allowing only a singe row to be edited also provides more intuitive validation, because only a single row’s data is submitted for validation, and therefore only errors for that row are displayed. 10-8 Web User Interface Developers Guide for Oracle Application Development Framework components automatically establish the currency to the row for which the context menu is being displayed. Establishing currency means that the current row in the model for the table now points to the row for which the context menu is being displayed. In order for this to happen, the popup component containing the menu must have its contentDelivery attribute set to lazyUncached so that the menu is fetched every time it is displayed. Tip: If you want the context menu to dynamically display content based on the selected row, set the popup content delivery to lazyUncached and add a setPropertyListener tag to a method on a managed bean that can get the current row and then display data based on the current row: af:tree value={fs.treeModel} contextMenuSelect=false var=node .. f:facet name=contextMenu af:popup id=myPopup contentDelivery=lazyUncached af:setPropertyListener from={fs.treeModel.rowData} to={dynamicContextMenuTable.currentTreeRowData} type=popupFetch af:menu af:menu text=Node Info Dynamic af:commandMenuItem actionListener= {dynamicContextMenuTable.alertTreeRowData} text= Name - {dynamicContextMenuTable.currentTreeRowData.name} af:commandMenuItem actionListener= {dynamicContextMenuTable.alertTreeRowData} text= Path - {dynamicContextMenuTable.currentTreeRowData.path} af:commandMenuItem actionListener= {dynamicContextMenuTable.alertTreeRowData} text=Date - {dynamicContextMenuTable.currentTreeRowData.lastModified} af:menu af:menu af:popup f:facet ... af:tree The code on the backing bean might look something like this: public class DynamicContextMenuTableBean { ... public void setCurrentTreeRowDataMap currentTreeRowData { _currentTreeRowData = currentTreeRowData; } public Map getCurrentTreeRowData { return _currentTreeRowData; } private Map _currentTreeRowData; }