Package org.apache.myfaces.trinidad.context

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


    RenderingContext arc,
    UIComponent         comp,
    FacesBean           bean) throws IOException
  {
    super.encodeEnd(context, arc, comp, bean);
    FormData fd = arc.getFormData();
    if (fd != null)
      fd.addNeededValue(XhtmlConstants.SOURCE_PARAM);
  }
View Full Code Here


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

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

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

                              RenderingContext rc,
                              UIXHierarchy tree,
                              FacesBean bean)
    throws IOException
  {
    FormData fd = rc.getFormData();
    if (fd == null)
    {
      _LOG.warning("The tree component must be used inside of a 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);
    }

    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");
    rw.endElement("div");
   
    fd.addNeededValue(selectedParam);
    fd.addNeededValue(_PATH_PARAM);


  }
View Full Code Here

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

    FormData fData = arc.getFormData();
    if (fData == null)
    {
      _LOG.warning("showDetail is not in a form, and " +
                   "will not function correctly");
      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

     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

     String              event,
     String              extraParams,
     boolean             returnTrue)
  {
    // Get the formName
    FormData fData = arc.getFormData();
    if (fData == null)
      return null;

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

    String startString = _START;
View Full Code Here

    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

    throws IOException
  {
    if((train.getFormName() != null) && supportsScripting(arc))
    {
      // render hidden fields to hold the form data
      FormData formData = arc.getFormData();
      if (formData != null)
      {
        formData.addNeededValue(XhtmlConstants.EVENT_PARAM);
        formData.addNeededValue(XhtmlConstants.SOURCE_PARAM);
        formData.addNeededValue(XhtmlConstants.VALUE_PARAM);
        formData.addNeededValue(XhtmlConstants.SIZE_PARAM);
      }

      // Render script submission code.
      ProcessUtils.renderNavSubmitScript(context, arc);
    }
View Full Code Here

    String           name2,
    String           name3,
    String           name4
    )
  {
    FormData fd = RenderingContext.getCurrentInstance().getFormData();
    fd.addNeededValue(name1);
    if (name2!=null)
    {
      fd.addNeededValue(name2);
      if (name3!=null)
      {
        fd.addNeededValue(name3);
        if (name4!=null)
        {
          fd.addNeededValue(name4);
        }
      }
    }
  }
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.