1 Reply Latest reply on Jul 17, 2007 2:14 PM by Raymond Eperen

    Nesting JSF components inside RichFaces

    Raymond Eperen Newbie

      I am new to RichFaces and JSF. I am programmatically creating a RichFaces PanelBar with several PanelBarItems. The PanelBarItems have nested PanelBar and PanelBarItems. Up to here it works fine. Inside the inner PanelBarItems I need to nest some JSF Components - an HTMLPanelGrid with some outputText and CommandLinks etc. These seem to compile and run, but nothing is displayed - only the RichFaces components display. The code is below. Any ideas?


      From xhtml page:

      <rich:panelBar binding="#{datasetManagementMainWebBean.scheduleBar}"/>

      From backing bean:
       * Programmatically builds the RichFaces PanelBar component. One panel item is built for each schedule in scheduleList
       * and each of those has a panel bar created with one panel item for each dataset that has been received against that schedule.
       * Each dataset panel item is them populated with various components based on their state.
       * @return the RichFaces HtmlPanelBar object
       public HtmlPanelBar getScheduleBar()
       if (this.isValidConfig())
       DatasetScheduleDO schedule;
       HtmlPanelBar datasetBar;
       HtmlPanelBarItem scheduleItem;
       HtmlDataGrid datasetGrid;
       HtmlOutputText receiveText;
       DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM);
       // build the panel bar for the schedules
       Application app = FacesContext.getCurrentInstance().getApplication();
       this.scheduleBar = (HtmlPanelBar) app.createComponent(HtmlPanelBar.COMPONENT_TYPE);
       for (int x = 0; x < this.scheduleList.size(); x++)
       // build a panel bar item for each schedule
       schedule = this.scheduleList.get(x);
       scheduleItem = new HtmlPanelBarItem();
       scheduleItem.setId("schedule" + schedule.getId());
       if (!schedule.getDatasets().isEmpty())
       // build a panel bar for the datasets
       datasetBar = new HtmlPanelBar();
       datasetBar.setId("scheduleDatasets" + schedule.getId());
       HtmlPanelBarItem datasetItem;
       DatasetDO dataset;
       for (int y = 0; y < schedule.getDatasets().size(); y++)
       // build the panel bar item for each dataset
       dataset = schedule.getDatasets().get(y);
       datasetItem = new HtmlPanelBarItem();
       datasetItem.setId("dataset" + dataset.getId());
       datasetItem.setLabel("Datagate Id: " + dataset.getDatagateId() + " - " + dataset.getDatasetName());
       // build the data grid to contain the dataset details
       datasetGrid = new HtmlDataGrid();
       datasetGrid.setId("datasetGrid" + dataset.getId());
       // put the receive data into the grid
       receiveText = new HtmlOutputText();
       receiveText.setId("receiveText" + dataset.getId());
       receiveText.setTitle("The title");
       receiveText.setValue("Received: " + df.format(dataset.getReceiveDate()) + " by "
       + dataset.getReceiveUser());
       return this.scheduleBar;