Package com.liferay.faces.alloy.component.tab

Examples of com.liferay.faces.alloy.component.tab.Tab


            clientId + TabViewRenderer.SELECTED_INDEX));

      // If iterating over a data model, then determine the row data and tab associated with the data model
      // iteration.
      Object rowData = null;
      Tab tab = null;
      String var = getVar();

      if (var != null) {
        setRowIndex(selectedIndex);
        rowData = getRowData();
View Full Code Here


    TabView tabView = (TabView) uiComponent;
    Integer selectedIndex = tabView.getSelectedIndex();
    Object value = tabView.getValue();
    String var = tabView.getVar();
    boolean iterateOverDataModel = ((value != null) && (var != null));
    Tab prototypeChildTab = null;

    if (uiComponent instanceof TabView) {
      prototypeChildTab = TabUtil.getFirstChildTab(tabView);
    }

    // Encode the starting <ul> unordered list element that represents the list of clickable tabs.
    ResponseWriter responseWriter = facesContext.getResponseWriter();
    responseWriter.startElement(StringPool.UL, tabView);
    RendererUtil.encodeStyleable(responseWriter, tabView, NAV_NAV_TABS);

    if (iterateOverDataModel) {

      if (prototypeChildTab != null) {

        int rowCount = tabView.getRowCount();

        for (int i = 0; i < rowCount; i++) {
          tabView.setRowIndex(i);

          boolean selected = ((selectedIndex != null) && (i == selectedIndex));
          encodeTabListItem(facesContext, responseWriter, prototypeChildTab, selected);
        }

        tabView.setRowIndex(-1);

      }
      else {
        logger.warn("Unable to iterate because aui:tabView does not have an aui:tab child element.");
      }
    }
    else {
      List<UIComponent> children = uiComponent.getChildren();
      int childCount = children.size();

      for (int i = 0; i < childCount; i++) {
        UIComponent child = children.get(i);

        if ((child instanceof Tab) && child.isRendered()) {
          Tab childTab = (Tab) child;
          boolean selected = ((selectedIndex != null) && (i == selectedIndex));
          encodeTabListItem(facesContext, responseWriter, childTab, selected);
        }
        else {
          logger.warn("Unable to render child element of alloy:tabView since it is not alloy:tab");
View Full Code Here

    List<UIComponent> children = tabView.getChildren();

    for (UIComponent child : children) {

      if ((child instanceof Tab) && child.isRendered()) {
        Tab childTab = (Tab) child;

        if (childTab.isDisabled()) {
          responseWriter.write(clientVarName);
          responseWriter.write(".disableTab(");
          responseWriter.write(Integer.toString(tabIndex));
          responseWriter.write(");");
        }
View Full Code Here

            clientId + AccordionRenderer.SELECTED_INDEX));

      // If iterating over a data model, then determine the row data and tab associated with the data model
      // iteration.
      Object rowData = null;
      Tab tab = null;
      String var = getVar();

      if (var != null) {
        setRowIndex(selectedIndex);
        rowData = getRowData();
View Full Code Here

    ResponseWriter responseWriter = facesContext.getResponseWriter();

    if (iterateOverDataModel) {

      // Get the first child tab and use it as a prototype tab.
      Tab prototypeChildTab = TabUtil.getFirstChildTab(accordion);

      if (prototypeChildTab != null) {

        // Encode a header <div> and content <div> for each row in the data-model.
        int rowCount = accordion.getRowCount();

        for (int i = 0; i < rowCount; i++) {
          accordion.setRowIndex(i);

          boolean selected = ((selectedIndex != null) && (i == selectedIndex));
          encodeHeader(facesContext, responseWriter, uiComponent, prototypeChildTab, selected);
          encodeContent(facesContext, responseWriter, uiComponent, prototypeChildTab, selected);
        }

        accordion.setRowIndex(-1);
      }
      else {
        logger.warn("Unable to iterate because alloy:accordion does not have an alloy:tab child element.");
      }
    }

    // Otherwise, encode a header <div> and content <div> for each child tab of the specified accordion.
    else {
      List<UIComponent> children = uiComponent.getChildren();
      int childCount = children.size();

      for (int i = 0; i < childCount; i++) {

        UIComponent child = children.get(i);

        if ((child instanceof Tab) && child.isRendered()) {
          Tab childTab = (Tab) child;
          boolean selected = ((selectedIndex != null) && (i == selectedIndex));
          encodeHeader(facesContext, responseWriter, uiComponent, childTab, selected);
          encodeContent(facesContext, responseWriter, uiComponent, childTab, selected);
        }
        else {
View Full Code Here

TOP

Related Classes of com.liferay.faces.alloy.component.tab.Tab

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.