Package org.apache.myfaces.trinidad.context

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


  {
    ResponseWriter rw = context.getResponseWriter();
    String value = getConvertedString(context, component, bean);

    String forId = getForId(context, component, bean);
    FormData fd = rc.getFormData();
    if (fd != null)
      fd.addLabel(forId, value);

    String messageType = _getMessageType(context, component, bean, forId);

    boolean noSpanNeeded =
      ((value == null) &&
View Full Code Here


      if(
         domLevel == null ||
         domLevel == TrinidadAgent.DOM_CAP_NONE ||
         domLevel == TrinidadAgent.DOM_CAP_FORM)
      {
        FormData formData = rc.getFormData();
        if(formData != null)
        {
          boolean isPIE = Agent.PLATFORM_PPC.equalsIgnoreCase(
                       rc.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);

            // In the case of Windows-mobile(WM) browsers, store the value of
            // the request-header field, UA-pixels, into a hidden-parameter's
            // value attribute. WM browsers' PPRs don't contain UA-pixels in
            // their request-headers. So during a WM browser's PPR, we need to
            // manually (using JavaScript) set the field, UA-pixels, into
            // the request-header with the hidden parameter's value.

            Map<String, String> headerMap =
                        context.getExternalContext().getRequestHeaderMap();

            _renderHiddenField(writer,
                               XhtmlConstants.WINDOWS_MOBILE_UAPIXELS,
                               headerMap.get("UA-pixels"));

          }
          else
          {
            formData.addNeededValue(XhtmlConstants.SOURCE_PARAM);
            formData.addNeededValue(XhtmlConstants.EVENT_PARAM);
          }
        }
      }

      _renderNeededValues(context, rc);
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, tree, 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, tree, 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

    int[]            selectedIndices,
    Converter        converter,
    boolean          valuePassThru
    ) throws IOException
  {
    FormData fData = rc.getFormData();
    if (fData == null)
    {
      _LOG.warning("COMPONENT_REQUIRES_FORM", component);
      return;
    }
View Full Code Here

    if (isAutoSubmit(component, bean))
      AutoSubmitUtils.writeDependencies(context, rc);

    // 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 = rc.getFormData();
    if (fData != null)
    {
      ((CoreFormData) fData).addOnSubmitConverterValidators(component,
                      valuePassThru ? converter : null,
                      valuePassThru ? getValidators(component, bean) : null,
View Full Code Here

    boolean isInTable = _isInTable();

    if (hasOwnLabel(component, bean) || isInTable)
    {
      String value = getLabel(component, bean);
      FormData fd = rc.getFormData();
      if (fd != null)
        fd.addLabel(clientId, value);
    }

    RequestContext requestContext = RequestContext.getCurrentInstance();
    boolean needsPanelFormLayout = _isParentPanelForm(context, component);
    boolean isInline = (requestContext.getClientValidation() ==
View Full Code Here

    if (isAutoSubmit(component, bean))
      AutoSubmitUtils.writeDependencies(context, rc);

    // 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 = rc.getFormData();
    if (fData != null)
    {
      ((CoreFormData) fData).addOnSubmitConverterValidators(component,
                      valuePassThru ? converter : null,
                      valuePassThru ? getValidators(component, bean) : null,
View Full Code Here

      if(
        domLevel == null ||
        domLevel == TrinidadAgent.DOM_CAP_NONE ||
        domLevel == TrinidadAgent.DOM_CAP_FORM)
      {
        FormData formData = rc.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

    RenderingContext rc,
    UIComponent      component,
    FacesBean        bean
    ) throws IOException
  {
    FormData fData = rc.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(rc);
      if (!pprEnabled)
      {
        fData.addNeededValue(XhtmlConstants.TARGETITEM_PARAM);
      }
    }

    List<UIComponent> children = component.getChildren();
    int numChildren = children.size();
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.