Package javax.faces.component

Examples of javax.faces.component.UIForm


        {
            return;
        }
        */

        UIForm htmlForm = (UIForm)component;

        Map paramMap = facesContext.getExternalContext().getRequestParameterMap();
        String submittedValue = (String)paramMap.get(component.getClientId(facesContext) +
                                                     HIDDEN_SUBMIT_INPUT_SUFFIX);
        if (submittedValue != null && submittedValue.equals(HIDDEN_SUBMIT_INPUT_VALUE))
        {
            htmlForm.setSubmitted(true);
        }
        else
        {
            htmlForm.setSubmitted(false);
        }
    }
View Full Code Here


        return "return false;";
      }
    } else {
      // Server
      //xxx by nick - denis - use org.ajax4jsf.renderkit.RendererUtils#getNestingForm(FacesContext, UIComponent)
      UIForm Form= getUtils().getNestingForm(context, component);
      String formId=null;     
      if (Form!=null){
         formId = Form.getClientId(context);
      }           
      if(formId==null) {
        throw new RuntimeException("toogleControl (id=\"" + component.getClientId(context) + "\") did not find parent form.");
      }
      onClick.append("TogglePanelManager.toggleOnServer('")
View Full Code Here

  /* (non-Javadoc)
   * @see org.ajax4jsf.renderkit.RendererBase#doDecode(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
   */
  protected void doDecode(FacesContext context, UIComponent component) {
    UIForm form = getUtils().getNestingForm(context,component);
    if(null != form){
      String hiddenFieldId = getHiddenFieldId(context, form, component);
      Object hiddenFieldValue;
      if(null != (hiddenFieldValue=context.getExternalContext().getRequestParameterMap().get(hiddenFieldId))){
        if(component.getClientId(context).equals(hiddenFieldValue)){
View Full Code Here

    writer.startElement(HTML.a_ELEMENT,component);
    getUtils().encodeId(context,component);
    getUtils().encodeAttributesFromArray(context,component,HTML.PASS_THRU_STYLES);
    getUtils().encodePassThruWithExclusionsArray(context,component,LINK_EXCLUSIONS);
    writer.writeAttribute("href","#",null);
    UIForm form = getUtils().getNestingForm(context,component);
    String clientId = component.getClientId(context);
    if(null == form){
      if(_log.isWarnEnabled()){
        _log.warn(Messages.getMessage(Messages.COMMAND_LINK_NOT_IN_FORM_WARNING, clientId));
      }
      return;
    }
    // Encode onclick attribute.
    Object click = component.getAttributes().get("onclick");
    StringBuffer onclick = new StringBuffer(256);
    if(null != click){
      onclick.append(click).append(';');
    }
    JSFunction submit = new JSFunction(AjaxFormRenderer.FORM_SUBMIT_FUNCTION_NAME);
    submit.addParameter(clientId);
    submit.addParameter(form.getClientId(context));
    submit.addParameter(component.getAttributes().get("target"));
    Map parameters = new HashMap();
    for (Iterator iter = component.getChildren().iterator(); iter.hasNext();) {
      Object child =  iter.next();
      if (child instanceof UIParameter) {
View Full Code Here

   *  
   * @see org.ajax4jsf.renderkit.RendererBase#doDecode(javax.faces.context.FacesContext,
   *      javax.faces.component.UIComponent)
   */
  protected void doDecode(FacesContext context, UIComponent component) {
    UIForm form = (UIForm) component;
    boolean submitted = context.getExternalContext()
        .getRequestParameterMap().containsKey(
            component.getClientId(context));
    form.setSubmitted(submitted);
    if (component instanceof UIAjaxForm) {
        UIAjaxForm ajaxForm = (UIAjaxForm) component;
      if (submitted && ajaxForm.isAjaxSubmit()) {
        component.queueEvent(new AjaxEvent(component));
      }       
View Full Code Here

                         * If the component is a UIForm and it is prepending its
                         * id then we can short circuit out of here if the the
                         * client id of the component we are trying to find does
                         * not begin with the id of the UIForm.
                         */
                        UIForm form = (UIForm) component;
                        if (form.isPrependId() && !clientId.startsWith(form.getClientId(visitContext.getFacesContext()))) {
                            result = VisitResult.REJECT;
                        }
                    } else if (component instanceof NamingContainer &&
                            !clientId.startsWith(component.getClientId(visitContext.getFacesContext()))) {
                        /*
 
View Full Code Here

    @Override
    public void encodeBegin(FacesContext context, UIComponent component)
          throws IOException {
        if (context.isProjectStage(ProjectStage.Development)) {
            boolean produceMessage = false;
            UIForm form = RenderKitUtils.getForm(component, context);
            if (null != form) {
                String encType = (String)form.getAttributes().get("enctype");
                if (null == encType || !encType.equals("multipart/form-data")) {
                    produceMessage = true;
                }
            } else {
                produceMessage = true;
View Full Code Here

                    "If you need to disable this check (on your own risk!) set the param " +
                    "org.apache.myfaces.VALIDATE in your web.xml context parameters to false");
            }
        }

        UIForm htmlForm = (UIForm) component;

        ResponseWriter writer = facesContext.getResponseWriter();
        String clientId = htmlForm.getClientId(facesContext);
        String actionURL = getActionUrl(facesContext, htmlForm);
        String method = getMethod(facesContext, htmlForm);
        String acceptCharset = getAcceptCharset(facesContext, htmlForm);

        writer.startElement(HTML.FORM_ELEM, htmlForm);
View Full Code Here

        {
            return;
        }
        */

        UIForm htmlForm = (UIForm) component;

        Map paramMap = facesContext.getExternalContext().getRequestParameterMap();
        String submittedValue = (String) paramMap.get(component.getClientId(facesContext) +
            HIDDEN_SUBMIT_INPUT_SUFFIX);
        if (submittedValue != null && submittedValue.equals(HIDDEN_SUBMIT_INPUT_VALUE)) {
            htmlForm.setSubmitted(true);
        }
        else {
            htmlForm.setSubmitted(false);
        }
    }
View Full Code Here

    public void encodeBegin(FacesContext facesContext, UIComponent component)
            throws IOException
    {
        org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.checkParamValidity(facesContext, component, UIForm.class);

        UIForm htmlForm = (UIForm)component;

        ResponseWriter writer = facesContext.getResponseWriter();
        String clientId = htmlForm.getClientId(facesContext);
        String acceptCharset = getAcceptCharset(facesContext, htmlForm);
        String actionURL = getActionUrl(facesContext, htmlForm);
        String method = getMethod(facesContext, htmlForm);

        writer.startElement(HTML.FORM_ELEM, htmlForm);
View Full Code Here

TOP

Related Classes of javax.faces.component.UIForm

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.