Package org.apache.myfaces.trinidad.context

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


    RenderingContext rc,
    UIComponent      component,
    FacesBean        bean
    ) throws IOException
  {
    FormData fd = rc.getFormData();

    if (fd == null)
      return null;

    fd.addNeededValue("part");

    // this is added for bug 4482982; when the selectInputDate or
    // selectInputText icon is selected in PocketIE, the script requires
    // the source hidden element to exist
    fd.addNeededValue(XhtmlConstants.SOURCE_PARAM);

    // Use a PPR autosubmit to launch the dialog only if we know
    // that we can use a separate window;  otherwise, just
    // use an ordinary request (since we're going to have to
    // refresh the whole window anyway)
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

    boolean isInTable = _isInTable();

    if (hasOwnLabel(bean) || isInTable)
    {
      String value = getLabel(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(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

      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);

            // 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, 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

  {
    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

    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

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.