Skip Headers
Oracle® Application Development Framework Developer's Guide For Forms/4GL Developers
10g (10.1.3.1.0)

Part Number B25947-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

14.4 Modifying the Attributes Displayed in the Table

Once you use the Data Control Palette to create a table, you can then delete attributes, change the order in which they are displayed, change the component used to display them, and change the attribute binding for the component. You can also add new attributes. Before you add new attributes, make sure the table binding includes the attribute you want to display in the table.

14.4.1 How to Modify the Displayed Attributes

You can modify the following aspects of a table that was created using the Data Control Palette.

  • Change the binding for the label of a column

  • Change the attribute to which a UI component is bound

  • Change the UI component bound to an attribute

  • Reorder the columns in the table

  • Delete a column in the table

  • Add a column to the table

To change the attributes for a table:

  1. In the Structure window, right-click af:table and choose Edit Columns.

  2. In the Edit Table Columns dialog, you can do the following:

    • Change the display label for the column. By default, the label is bound to the labels property for the attribute on the table binding. For more information about the labels property, see Appendix B, "Reference ADF Binding Properties". The bindings to the labels property allow the labels to be inherited from the UI control hints that you have defined in your business domain layer, thus enabling you to change the value of a label text once in a central place, and have the change appear the same on all pages that display the label. In this dialog, you can instead enter text or an EL expression to bind the label value to something else, for example, a key in a resource file.

      For example, the heading for the Status column in the table on the SRList page is bound to the labels property that uses the Status key to get the attribute:

      #{bindings.LoggedInUserServiceRequests.labels.Status}
      
      

      However, you could change it to instead be bound to a key in a properties resource file, for example:

      #{srlist['sr.status']}
      
      

      In this example, srlist would be a variable defined in the JSF page used to load a properties file. For more information about using resource bundles, see Section 22.4, "Internationalizing Your Application".

    • Change the attribute binding for a column.

      For example, you can change the Status column to instead be bound to the RequestDate attribute. Note the following:

      • If you change the binding, the label for the column also changes.

      • If you change the binding to an attribute currently bound to another column, the UI component changes to a component different from that used for the column currently bound to that attribute.

      If you simply want to rearrange the columns, you should use the order buttons, as described later in the section.

    • Change the UI component used to display the attribute. The UI components are either inputText or outputText and are set based on the composite component you selected when you dropped the collection onto the page. You can change to the other UI component using the dropdown menu. If you want to use an entirely different component, such as a command link or button, you need to use this dialog to change to an outputText component, and then in the Structure window, replace the outputText component with the desired UI component (such as a command link).


      Tip:

      You can use the following UI components in a table with the noted caveats:
      • The selectBooleanCheckbox component can be used inside a table if it is only handling boolean or java.lang.Boolean types.

      • The selectOneListbox/Choice/Radio components can be used inside the table if you manually add the list of choices as an enumeration. If instead you want to use a list binding, then the selectOne UI component cannot be used inside a table. For more information on list bindings, see Section 19.7, "Creating Selection Lists".


    • Change the order of the columns using the order buttons. Top moves the column to the first column at the left of the table. Up moves the column one column to the left. Down moves the column one to the right. Bottom moves the column to the very right.

    • Add a column using the New button. Doing so adds a new column at the bottom of the dialog and populates it by default with values from the next sequential attribute in the collection. You then need to edit the values. You can only select an attribute associated with the object to which the table is bound.

    • Delete a column using the Delete button. Doing so deletes the column from the table.

    • Add a tableSelectOne component to the table's selection facet by selecting Enable selection. For more information, see Section 14.6, "Enabling Row Selection in a Table".

    • Add sorting capabilities by selecting Enable sorting.

14.4.2 How to Change the Binding for a Table

Instead of modifying a binding, you can completely change the object to which the table is bound.

To rebind a table:

  1. Right-click the table in the Structure window and choose Edit Binding to launch the Table Binding Editor.

  2. In the editor, select the new collection to which you want to bind the table. Note that changing the binding for the table will also change the binding for all the columns. You can then use the procedures in Section 14.4.1, "How to Modify the Displayed Attributes" to modify those bindings.

14.4.3 What Happens When You Modify Bindings or Displayed Attributes

When you simply modify how an attribute is displayed, by moving the UI component or changing the UI component, JDeveloper changes the corresponding code on the JSF page. When you use the binding editors to add or change a binding, JDeveloper adds the code to the JSF page, and also adds the appropriate elements to the page definition file.