Package org.apache.myfaces.trinidad.component

Examples of org.apache.myfaces.trinidad.component.UIXTreeTable


      context.getExternalContext().getRequestParameterMap();
   
    Object source = parameters.get(XhtmlConstants.SOURCE_PARAM);
    if (component.getClientId(context).equals(source))
    {
      UIXTreeTable treeTable = (UIXTreeTable) component;
      TreeUtils.decodeExpandEvents(parameters, component,
                                   TreeUtils.getFocusRowKey(treeTable));
      TreeUtils.decodeFocusEvent(parameters, component);
      TreeUtils.decodeGotoEvent(parameters, component);
      // bug 4522210:
View Full Code Here


  private void _renderTableRows(
    FacesContext          context,
    final RenderingContext   arc,
    final TreeTableRenderingContext ttrc) throws IOException
  {
    final UIXTreeTable treeTableBase = ttrc.getUIXTreeTable();
    final ResponseWriter writer = context.getResponseWriter();
    final RowKeySet treeState = treeTableBase.getDisclosedRowKeys();
    final int specialColCount = _getSpecialColCount(ttrc);

    TableUtils.RowLoop loop = new TableUtils.RowLoop()
    {
      @Override
      protected void loop(FacesContext context, CollectionComponent treeTable)
        throws IOException
      {
        Object focusPath = TreeUtils.getFocusRowKey(treeTableBase);
        treeTableBase.setRowKey(focusPath);
        processRow(context, treeTable);
      }

      @Override
      protected void processRowImpl(FacesContext context, CollectionComponent treeTable)
        throws IOException
      {
        writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null);
        renderSingleRow(context, arc, ttrc, treeTableBase);
        writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT);
//
  //        if (hasInvisibleNodes)
  //        {
  //          //context.addHiddenDataObject(treeTableBase.getRowData());
  //        }

        if (treeTableBase.isContainer())
        {
          if (treeState.isContained())
          {
            treeTableBase.enterContainer();
            int rows = treeTableBase.getRows();
            int rowCount = treeTableBase.getRowCount();
            boolean renderNavRow = (rows > 0) &&
              ((rowCount < 0) || (rowCount > rows));
            if (renderNavRow)
            {
              renderEmptyTableRow(context, arc, ttrc, specialColCount, _NAV_TOP);
            }
            super.loop(context, treeTable);
            if (renderNavRow)
            {
              renderEmptyTableRow(context, arc, ttrc, specialColCount, _NAV_BOTTOM);
            }
            treeTableBase.exitContainer();
          }
        }
      }
    };
View Full Code Here

      UIComponent child,
      int renderedCount,
      boolean isLastChild) throws IOException
    {
      TreeTableRenderingContext ttrc = TreeTableRenderingContext.getInstance();
      UIXTreeTable tree = ttrc.getUIXTreeTable();
      ResponseWriter out = context.getResponseWriter();
      out.startElement("a", tree);
      out.writeURIAttribute("href", "#" , null);
      // put style classes on the links
      if (isLastChild)
      {
        renderStyleClass(
          context, arc,
          SkinSelectors.AF_TREE_TABLE_MP_SELECTED_STYLE_CLASS);
      }
      else
      {
        renderStyleClass(
          context, arc,
          SkinSelectors.AF_TREE_TABLE_MP_STEP_STYLE_CLASS);
      }
      Object oldPath = tree.getRowKey();
      Object focusRowKey = ttrc.getFocusRowKey();
      List<Object> focusPath = tree.getAllAncestorContainerRowKeys(focusRowKey);
      Object crumbPath = (renderedCount < focusPath.size())
        ? focusPath.get(renderedCount)
        : focusRowKey;
      try
      {
        tree.setRowKey(crumbPath);
        String onclick =
          TreeUtils.callJSFocusNode(tree, ttrc.getJSVarName());
        out.writeAttribute("onclick", onclick , null);
        super.renderLink(context, arc, child, renderedCount, isLastChild);
      }
      finally
      {
        tree.setRowKey(oldPath);
      }
      out.endElement("a");
    }
View Full Code Here

      context.getExternalContext().getRequestParameterMap();

    Object source = parameters.get(XhtmlConstants.SOURCE_PARAM);
    if (component.getClientId(context).equals(source))
    {
      UIXTreeTable treeTable = (UIXTreeTable) component;
      TreeUtils.decodeExpandEvents(parameters, component,
                                   TreeUtils.getFocusRowKey(treeTable));
      TreeUtils.decodeFocusEvent(parameters, component);
      TreeUtils.decodeGotoEvent(parameters, component);
      // bug 4522210:
View Full Code Here

    final RenderingContext   arc,
    final TreeTableRenderingContext ttrc,
    final FacesBean bean)
    throws IOException
  {
    final UIXTreeTable treeTableBase = ttrc.getUIXTreeTable();
    final ResponseWriter writer = context.getResponseWriter();
    final RowKeySet treeState = treeTableBase.getDisclosedRowKeys();
    final int specialColCount = _getSpecialColCount(ttrc);
    final boolean rootNodeRendered = isRootNodeRendered(bean);

    TableUtils.RowLoop loop = new TableUtils.RowLoop()
    {
      @Override
      protected void loop(FacesContext context, CollectionComponent treeTable)
        throws IOException
      {
        Object focusPath = TreeUtils.getFocusRowKey(treeTableBase);
        treeTableBase.setRowKey(focusPath);
        processRow(context, treeTable);
      }

      @Override
      protected void processRowImpl(FacesContext context, CollectionComponent treeTable)
        throws IOException
      {
        if (rootNodeRendered || treeTableBase.getDepth() > 0)
        {
          writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null);
          renderSingleRow(context, arc, ttrc, treeTableBase);
          writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT);
        }

//
  //        if (hasInvisibleNodes)
  //        {
  //          //context.addHiddenDataObject(treeTableBase.getRowData());
  //        }

        if (treeTableBase.isContainer())
        {
          if (treeState.isContained() || (rootNodeRendered == false && treeTableBase.getDepth() == 0))
          {
            treeTableBase.enterContainer();
            int rows = treeTableBase.getRows();
            int rowCount = treeTableBase.getRowCount();
            boolean renderNavRow = (rows > 0) &&
              ((rowCount < 0) || (rowCount > rows));
            if (renderNavRow)
            {
              renderEmptyTableRow(context, arc, ttrc, specialColCount, _NAV_TOP);
            }
            super.loop(context, treeTable);
            if (renderNavRow)
            {
              renderEmptyTableRow(context, arc, ttrc, specialColCount, _NAV_BOTTOM);
            }
            treeTableBase.exitContainer();
          }
        }
      }
    };
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.component.UIXTreeTable

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.