Displaying folder items

See Also  

To list and display a list of folders to the user, you add ItemsGrid and ItemsColumn components to the page. The ItemsGrid component renders repetitive information, such as lists of folders or reports, in a grid with rows and columns. Each row of the grid represents a separate item; in this tutorial, each item is a folder. Each column of the grid is an individual ItemsColumn component which represents different fields of the item.

Later, you add a Path component to the top of the page to add navigation capabilities.

To add an ItemsGrid component
  1. To leave room for the Path component, insert the cursor at the top of the page, and add a carriage return.
  2. In the Palette view, under the Crystal Reports Faces Components tab, click Enterprise ItemsGrid and drag an ItemsGrid component onto the page in the visual designer.
  3. In this step, you are prompted to specify the item source used in the ItemsGrid component.

    You must create an EnterpriseItems bean and bind it to the ItemsGrid component. The EnterpriseItems bean will represent the collection of folders to be displayed in the grid.

  4. In the New ItemsGrid window, leave the Item Source field empty and click New.
  5. You are prompted to choose an Identity bean. The EnterpriseItems bean has an identity property that must be initialized to an Identity bean that supplies the Enterprise session and user credentials.

  6. Choose the existing bean, identity, from the list, click Folders only, and then click Finish.
  7. This step adds the EnterpriseItems bean to the Item Source field in the New ItemsGrid window. Select it and then click Finish.

  8. In the Properties view, set the id attribute to foldersList.
  9. In the Properties view, clear the showDrillUpLink check box.
  10. Because navigation up the hierarchy of items is handled by the Path component, the link is not necessary.

  11. In the Properties view, clear the showHeader check box.
  12. The header field's visibility is controlled by this attribute. In this tutorial, the header field is hidden; however, the showHeader attribute can be set to true to display a column heading that describes each field in the grid.

  13. In the Properties view, set the showImages attribute to Icon.
  14. A representative icon image will be displayed to the user beside each item in the grid.

    Note:    The Icon field is a member of the com.businessobjects.jsf.sdk.properties.Image class.

When the ItemsGrid component is created, one or more ItemsColumn subcomponents are also created which represent the columns of the grid (the number of columns representing fields that are created by default can be customized; for details, see How to I change the default preferences of the UI components?). Those individual columns can be selected in the visual designer and edited.

For this grid, you want to display only a single column: the name of each folder. Therefore, you must keep the column that displays the SI_NAME field of the items, and then remove all other columns (such as the SI_PROGID or SI_DESCRIPTION field columns).

To remove a column (ItemsColumn component) from the ItemsGrid component

Repeat this step to remove all extra columns in the ItemsGrid component except the SI_NAME column. For more information on how to manipulate columns, see How do I manipulate columns in the ItemsGrid component?.



Business Objects
http://www.businessobjects.com/
Support services
http://www.businessobjects.com/services/support/