Package org.apache.myfaces.trinidad.context

Examples of org.apache.myfaces.trinidad.context.FormData


    FacesContext        context,
    RenderingContext arc,
    UIComponent         component,
    FacesBean           bean) throws IOException
  {
    FormData fData = arc.getFormData();
    if (fData != null)
    {
      fData.addNeededValue(XhtmlConstants.PARTIAL_TARGETS_PARAM);
      fData.addNeededValue(XhtmlConstants.PARTIAL_PARAM);
    }

    // we cannot render without a nodeStamp:
    if (((UIXTreeTable) component).getNodeStamp() == null)
    {
View Full Code Here


  /**
   * render form value needed values and javascript code.
   */
  public static void addHiddenFields(RenderingContext arc)
  {
    FormData fData = arc.getFormData();
    fData.addNeededValue(XhtmlConstants.EVENT_PARAM);
    fData.addNeededValue(XhtmlConstants.SOURCE_PARAM);
    fData.addNeededValue(XhtmlConstants.PARTIAL_PARAM);
    fData.addNeededValue(XhtmlConstants.VALUE_PARAM);
  }
View Full Code Here

      if(
         domLevel == null ||
         domLevel == TrinidadAgent.DOM_CAP_NONE ||
         domLevel == TrinidadAgent.DOM_CAP_FORM)
      {
        FormData formData = arc.getFormData();
        if(formData != null)
        {
          boolean isPIE = Agent.PLATFORM_PPC.equalsIgnoreCase(
                       arc.getAgent().getPlatformName());

          // =-=AdamWiner: this isn't correct - these
          // parameters should be added by the components that need
          // them, not globally by the form control
          if (isPIE)
          {
            formData.addNeededValue(XhtmlConstants.SOURCE_PARAM);
            formData.addNeededValue(XhtmlConstants.EVENT_PARAM);
            formData.addNeededValue(XhtmlConstants.PARTIAL_TARGETS_PARAM);
            formData.addNeededValue(XhtmlConstants.PARTIAL_PARAM);
          }
          else
          {
            formData.addNeededValue(XhtmlConstants.SOURCE_PARAM);
            formData.addNeededValue(XhtmlConstants.EVENT_PARAM);
          }
        }
      }

      _renderNeededValues(context, arc);
View Full Code Here

  public static void addLabelMapping(
    String           targetID,
    String           label
    )
  {
    FormData fData = RenderingContext.getCurrentInstance().getFormData();
    fData.addLabel(targetID, label);
  }
View Full Code Here

                              RenderingContext rc,
                              UIXHierarchy tree,
                              FacesBean bean)
    throws IOException
  {
    FormData fd = rc.getFormData();
    if (fd == null)
    {
      _LOG.warning("TREE_COMPONENT_MUST_INSIDE_FORM");
      return;
    }

    ResponseWriter rw = context.getResponseWriter();
    rw.startElement("div", tree);
    renderId(context, tree);
    renderAllAttributes(context, rc, bean);
   
    final String id = getClientId(context, tree);
    UIComponent stamp = getFacet(tree, CoreTree.NODE_STAMP_FACET);

    //@todo - will this tree.getFocusPath survive?
    //    List focusPath = getFocusPath(context, node);
    Object focusPath = tree.getFocusRowKey();
    String formName = fd.getName();

    // Bug 3931544:  don't use colons in Javascript variable names.
    // We'll just replace colons with underscores;  not perfect, but adequate
    final String varName = "_adftree" + XhtmlUtils.getJSIdentifier(id);

    boolean leftToRight = !rc.isRightToLeft();
    int rootSize = tree.getRowCount();
    RowKeySet state = getExpandedRowKeys(tree);
    Map<Object, Boolean> selectedPaths = getSelectedPaths(focusPath);

    // render each of the root nodes
    for (int i = 0; i < rootSize; i++)
    {
      tree.setRowIndex(i);
      _renderNode(context, rc, tree, bean, stamp, varName, state,
                  selectedPaths, new Boolean[_DEFAULT_TREE_DEPTH],
                  leftToRight, (i == 0), (i == rootSize - 1), 0);
    }

    //HKuhn - not needed in printable mode (scripting disabled)
    if (supportsScripting(rc))
    {
      rw.startElement("script", null);
      renderScriptDeferAttribute(context, rc);
      renderScriptTypeAttribute(context, rc);

      _renderTreeJS(context, rc, bean);

      //out.writeText("_setNodes('"+name+"','"+nodesRendered+"');");

      String selectedParam =
        id + NamingContainer.SEPARATOR_CHAR + SELECTED_PARAM;

      rw.writeText("var " + varName + " = " +
                       _createNewJSSelectionState(formName, id,
                                                  selectedParam), null);
      rw.endElement("script");

      fd.addNeededValue(selectedParam);
    }
    rw.endElement("div");

    fd.addNeededValue(_PATH_PARAM);

  }
View Full Code Here

     boolean             immediate,
     String              event,
     String              extraParams,
     boolean             returnTrue)
  {
    FormData fData = arc.getFormData();
    if (fData == null)
      return null;

    String formName = fData.getName();
    if (formName == null)
      return null;


    String startString = _FULL_PAGE_START;
View Full Code Here

     boolean             returnTrue)
  {
    StringBuilder builder = new StringBuilder();

    // Get the formName
    FormData formData = arc.getFormData();
    if (formData == null)
      return null;

    String formName = formData.getName();
    if (formName == null)
      return null;

    builder.append("TrPage._autoSubmit('");
    builder.append(formName);
View Full Code Here

      if (requiredField ||
          (converter != null) ||
          validators.hasNext())
      {

        FormData fData = rc.getFormData();
        if (fData == null)
        {
          _LOG.warning("COMPONENT_REQUIRES_FORM", component);
          return;
        }
View Full Code Here

    rw.writeAttribute("value",
                      getConvertedString(context, component, bean),
                      "value");
    rw.endElement("input");

    FormData fd = rc.getFormData();
    if (fd != null)
      fd.addRenderedValue(id);

  }
View Full Code Here

      // gives some beans the chance to cleanup:
      renderStage.setStage(RenderStage.END_STAGE);
      renderSingleRow(context, rc, tContext, component);

      String tid = tContext.getTableId();
      FormData formData = rc.getFormData();
      if (formData != null)
      {
        // Add sorting parameters.
        // =-=AdamWiner FIXME: only really needed with sorting.
        formData.addNeededValue(XhtmlConstants.STATE_PARAM);
        formData.addNeededValue(XhtmlConstants.VALUE_PARAM);

        //HKuhn - no need for scripts in printable mode
        if (supportsScripting(rc))
        {
          rw.startElement(XhtmlConstants.SCRIPT_ELEMENT, null);
          renderScriptDeferAttribute(context, rc);
          // Bug #3426092:
          // render the type="text/javascript" attribute in accessibility mode
          renderScriptTypeAttribute(context, rc);

          String formName = formData.getName();

          rw.writeText(tContext.getJSVarName()+"="+
                 TreeUtils.createNewJSCollectionComponentState(formName, tid)+";", null);
          rw.endElement(XhtmlConstants.SCRIPT_ELEMENT);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.context.FormData

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.