Package org.apache.myfaces.trinidad.context

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


      if(
        domLevel == null ||
        domLevel == TrinidadAgent.DOM_CAP_NONE ||
        domLevel == TrinidadAgent.DOM_CAP_FORM)
      {
        FormData formData = arc.getFormData();
        if(formData != null)
        {
          formData.addNeededValue(XhtmlConstants.STATE_PARAM);
        }     
      }
    }

    // we do not want to wrap if wrapping has explicitly been disabled. if we
View Full Code Here


      if(
        domLevel == null ||
        domLevel == TrinidadAgent.DOM_CAP_NONE ||
        domLevel == TrinidadAgent.DOM_CAP_FORM)
      {
        FormData formData = arc.getFormData();
        if(formData != null)
        {
          formData.addNeededValue(XhtmlConstants.STATE_PARAM);
        }     
      }
    }

    // we do not want to wrap if wrapping has explicitly been disabled. if we
View Full Code Here

    FacesContext        context,
    RenderingContext    arc,
    UIComponent         component,
    FacesBean           bean) throws IOException
  {
    FormData fData = arc.getFormData();
    String formName = "";

    if (fData != null)
    {
      formName = fData.getName();
      if (formName == null)
      {
        _LOG.warning("PANELACCORDION_MUST_INSIDE_FORM");
        return;
      }
      // Hidden field to store parameter targetItem is needed for non
      // Ajax browsers to pass the target item Id back to the server.
      boolean pprEnabled =
        PartialPageUtils.supportsPartialRendering(arc);
      if (!pprEnabled)
      {
        fData.addNeededValue(XhtmlConstants.TARGETITEM_PARAM);
      }
    }

    List<UIComponent> children = component.getChildren();
    int numChildren = children.size();
View Full Code Here

    UIComponent         component) throws IOException
  {
    if (!supportsNavigation(arc))
      return;

    FormData fData = arc.getFormData();
    if (fData == null)
    {
      _LOG.warning("SHOWDETAIL_NOT_IN_FORM_WILLNOT_FUNCTION_PROPERLY");
      return;
    }

    String valueValue = getValueParameter(component);


    ResponseWriter rw = context.getResponseWriter();
    boolean partial = PartialPageUtils.isPPRActive(context);

    // the first time, render the necessary Javascript
    if (arc.getProperties().get(_SHOW_DETAIL_SUBMIT_JS_RENDERED) == null)
    {
      arc.getProperties().put(_SHOW_DETAIL_SUBMIT_JS_RENDERED,
                              Boolean.TRUE);
      // write the submit function

      String js;
      // Javascript function, optimized to reduce size.  Parameters are:
      // a: form name
      // v: validate?
      // b: event name
      // c: source parameter (id)
      // l: ID of link (for focusing)
      // d: value parameter (for use in table)
      // =-=AEW Why bother including "document" and "window" in
      // _setRequestedFocusNode() call?  It could derive them itself.
      if (partial)
      {
        js =
          "function _submitHideShow(a,v,b,c,l,d) {" +
            "var o = {"+
                  XhtmlConstants.EVENT_PARAM + ":b," +
                  XhtmlConstants.SOURCE_PARAM + ":c};" +
            "if (d!=(void 0)) o." +
                  XhtmlConstants.VALUE_PARAM + "=d;" +
            "_setRequestedFocusNode(document,l,false,window);" +
            "_submitPartialChange(a,v,o);" +
            "return false;}";
      }
      else
      {
        js =
          "function _submitHideShow(a,v,b,c,l,d) {" +
            "var o={"+
                  XhtmlConstants.EVENT_PARAM + ":b," +
                  XhtmlConstants.SOURCE_PARAM + ":c};" +
            "if (d!=(void 0)) o." +
                  XhtmlConstants.VALUE_PARAM + "=d;" +
            "submitForm(a,v,o);" +
            "return false;}";
      }

      // write the submit function
      rw.startElement("script", null);
      renderScriptDeferAttribute(context, arc);
      renderScriptTypeAttribute(context, arc);

      rw.writeText(js, null);
      rw.endElement("script");

      // Add these needed values at most once per page
      fData.addNeededValue(XhtmlConstants.EVENT_PARAM);
      fData.addNeededValue(XhtmlConstants.SOURCE_PARAM);
      if (partial)
        fData.addNeededValue(XhtmlConstants.PARTIAL_PARAM);
    }

    // And add this needed value if it ever comes up
    if (valueValue != null)
      fData.addNeededValue(XhtmlConstants.VALUE_PARAM);

  }
View Full Code Here

    RenderingContext arc,
    UIComponent         component,
    FacesBean           bean,
    boolean             disclosed)
  {
    FormData fData = arc.getFormData();
    if (fData == null)
       return null;

    String sourceValue = getClientId(context, component);
    String formName = fData.getName();
    String eventValue = (disclosed
                         ? XhtmlConstants.HIDE_EVENT
                         : XhtmlConstants.SHOW_EVENT);
    String valueValue = getValueParameter(component);
    String linkId = getLinkId(sourceValue, disclosed);
View Full Code Here

    RenderingContext arc,
    UIComponent         component,
    FacesBean           bean,
    boolean             disclosed)
  {
    FormData fData = arc.getFormData();
    if (fData == null)
       return null;
      
    String sourceValue = getClientId(context, component);
    String eventValue = (disclosed
View Full Code Here

    if (isAutoSubmit(bean))
      AutoSubmitUtils.writeDependencies(context, arc);

    // Only add in validators and converters when we're in valuePassThru
    // mode; otherwise, there's not enough on the client to even consider
    FormData fData = arc.getFormData();
    if (fData != null)
    {
      ((CoreFormData) fData).addOnSubmitConverterValidators(component,
                      valuePassThru ? converter : null,
                      valuePassThru ? getValidators(bean) : 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

                              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;
      String focusNodeId = TreeUtils.getFocusNodeClientId(context, tree);

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

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

    fd.addNeededValue(_PATH_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

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.