public SectionRepeater(
        String id,
        Iterable<XmlSection> sections,
        XmlSection currentSection,
        SectionIconFactory iconFactory) {
      super(id);

      for (XmlSection s : sections) {
        ISIXmlSection section = (ISIXmlSection) s;
        boolean current = section.equals(currentSection);

        WebMarkupContainer sectionContainer = new WebMarkupContainer(newChildId());
        add(sectionContainer);

        BookmarkablePageLink<ISIStandardPage> link =
            new SectionLinkFactory().linkToPage("sectionLink", section);
        sectionContainer.add(link);
        if (current) {
          link.setEnabled(false);
          link.add(new ClassAttributeModifier("current"));
          link.add(new IconContainer("iconContainer", section, iconFactory));
          sectionContainer.add(new WebMarkupContainer("current"));
        } else {
          WebMarkupContainer iconContainer = new WebMarkupContainer("iconContainer");
          link.add(iconContainer);
          iconContainer.add(iconFactory.getIconFor(section));
          sectionContainer.add(new WebMarkupContainer("current").setVisible(false));
        }
      }
    }
  /**
   * Construct nav bar based on a certain page that is currently being displayed.
   *
   * @param id
   * @param mCurrentPage - model of the XmlSection that is the current page.
   * @param teacher if true, a version of the nav bar appropriate for the teacher is produced.
   */
  public DefaultNavBar(String id, IModel<XmlSection> mCurrentPage, boolean teacher) {
    super(id, mCurrentPage);
    setOutputMarkupId(true);
    iconFactory = SectionIconFactory.getIconFactory(teacher);

    if (mCurrentPage == null) {
      setModel(new XmlSectionModel(ISIApplication.get().getPageNum(1)));
    }

    ISIXmlSection rootSection = ISIXmlSection.getRootSection(getCurrentSection());

    // Current Section's Page Repeater with prev/next
    PageNavPanel pageNavPanelTop = new PageNavPanel("pageNavPanelTop", getModel());
    add(pageNavPanelTop);

    /** ******* Other * ******* */
    // Jump to a certain page
    add(new QuickFlipForm("quickFlipForm", true));

    // Chapter Title (xml level 1)
    add(new Label("title", rootSection.getTitle()));
  }
 @Override
 protected void onBeforeRender() {
   Component teacherStatusIcon = iconFactory.getIconFor(section);
   addOrReplace(teacherStatusIcon);
   super.onBeforeRender();
 }