Package javax.faces.component

Examples of javax.faces.component.UIForm


    UIComponent parent = component.getParent();
    while (parent != null && !(parent instanceof UIForm)) {
      parent = parent.getParent();
    }

    UIForm nestingForm = null;
    if (parent != null) {
      // link is nested inside a form
      nestingForm = (UIForm) parent;
    }
    return nestingForm;
View Full Code Here


   * @return
   * @throws IOException
   */
  public void encodeBeginFormIfNessesary(FacesContext context,
      UIComponent component) throws IOException {
    UIForm form = getNestingForm(context, component);
    if (null == form) {
      ResponseWriter writer = context.getResponseWriter();
      String clientId = component.getClientId(context) + DUMMY_FORM_ID;
      encodeBeginForm(context, component, writer, clientId);
      // writer.writeAttribute(HTML.style_ATTRIBUTE, "margin:0;
View Full Code Here

   * @param component
   * @throws IOException
   */
  public void encodeEndFormIfNessesary(FacesContext context,
      UIComponent component) throws IOException {
    UIForm form = getNestingForm(context, component);
    if (null == form) {
      ResponseWriter writer = context.getResponseWriter();
      // TODO - hidden form parameters ?
      encodeEndForm(context, writer);
    }
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

        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.");
      }
View Full Code Here

            isReadOnly(component)) {
            return;
        }

        // Set up variables we will need
        UIForm form = null;
        UIComponent parent = component.getParent();
        while (parent != null) {
            if (parent instanceof UIForm) {
                form = (UIForm) parent;
                break;
View Full Code Here

            isReadOnly(component)) {
            return;
        }

        // Set up variables we will need
        UIForm form = null;
        UIComponent parent = component.getParent();
        while (parent != null) {
            if (parent instanceof UIForm) {
                form = (UIForm) parent;
                break;
            }
            parent = parent.getParent();
        }
        if (form == null) {
            log.warn("CommandLinkComponent not nested inside UIForm, ignored");
            return;
        }
        String formClientId = form.getClientId(context);

        // If this is the first nested command link inside this form,
        // render a hidden variable to identify which link did the submit
        String key = formClientId + NamingContainer.SEPARATOR_CHAR + TOKEN;
        if (context.getExternalContext().getRequestMap().get(key) == null) {
View Full Code Here

            isReadOnly(component)) {
            return;
        }

        // Set up variables we will need
        UIForm form = null;
        UIComponent parent = component.getParent();
        while (parent != null) {
            if (parent instanceof UIForm) {
                form = (UIForm) parent;
                break;
            }
            parent = parent.getParent();
        }
        if (form == null) {
            log.warn("CommandLinkComponent not nested inside UIForm, ignored");
            return;
        }
        String formClientId = form.getClientId(context);

        // Render the attributes of this hyperlink
        if (component.getId() != null) {
            writer.writeAttribute("id", component.getClientId(context), "id");
        }
View Full Code Here

import javax.faces.context.FacesContext;

public class FormRenderer extends RendererBase {

  public void decode(FacesContext facesContext, UIComponent component) {
    UIForm form = (UIForm) component;
    String actionId = FacesContextUtils.getActionId(facesContext);
    String clientId = form.getClientId(facesContext);
    if (actionId != null && actionId.startsWith(clientId)) {
      form.setSubmitted(true);
    }
    super.decode(facesContext, form);
  }
View Full Code Here

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

        UIForm htmlForm = (UIForm)component;

        ResponseWriter writer = facesContext.getResponseWriter();
        String clientId = htmlForm.getClientId(facesContext);
        String actionURL = getActionUrl(facesContext);

        writer.startElement(HTML.FORM_ELEM, htmlForm);
        writer.writeAttribute(HTML.ID_ATTR, clientId, null);
        writer.writeAttribute(HTML.NAME_ATTR, clientId, null);
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.