Package javax.faces

Examples of javax.faces.FacesException


   
    UIComponent parentForm = ComponentUtils.findParentForm(facesContext, tree);
    if(parentForm != null)
      formClientId = parentForm.getClientId(facesContext);
    else
      throw new FacesException("Tree:" + clientId + " needs to be enclosed in a form");
     
    writer.startElement("script", null);
    writer.writeAttribute("type", "text/javascript", null);

    //Nodes
View Full Code Here


    String clientId = ac.getClientId(facesContext);
    String var = createUniqueWidgetVar(facesContext, ac);
   
    UIComponent form = ComponentUtils.findParentForm(facesContext, ac);
    if(form == null) {
      throw new FacesException("AutoComplete : \"" + clientId + "\" must be inside a form");
    }
   
    writer.startElement("script", null);
    writer.writeAttribute("type", "text/javascript", null);
   
View Full Code Here

  public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException{
    ResponseWriter writer = facesContext.getResponseWriter();
    Message uiMessage = (Message) component;
    UIComponent target = uiMessage.findComponent(uiMessage.getFor());
    if(target == null) {
      throw new FacesException("Cannot find component \"" + uiMessage.getFor() + "\" in view.");
    }
     
    Iterator<FacesMessage> msgs = facesContext.getMessages(target.getClientId(facesContext));

    writer.startElement("span", uiMessage);
View Full Code Here

    if(isAjaxRequest) {
      try {
        handleAjaxRequest(facesContext);
      } catch (Exception e) {
        throw new FacesException(e);
      }
    }
  }
View Full Code Here

          Object paramValue = params.get(paramName);
          String json = isBean(paramValue) ? "{\"" + paramName + "\":" + new JSONObject(paramValue).toString() + "}": new JSONObject().put(paramName, paramValue).toString();
          writer.write(json);
        } catch (JSONException e) {
          logger.log(Level.SEVERE, "Error in serializing callback parameter \"{0}\"", paramName);
          throw new FacesException(e.getMessage());
        }
        writer.write("</callbackParam>")
       
      }
    writer.write("</callbackParams>")
View Full Code Here

    if(process.indexOf("@this") != -1)
      process = process.replaceFirst("@this", component.getClientId(facesContext));
    if(process.indexOf("@form") != -1) {
      UIComponent form = ComponentUtils.findParentForm(facesContext, component);
      if(form == null)
        throw new FacesException("Component " + component.getClientId(facesContext) + " needs to be enclosed in a form");
     
      process = process.replaceFirst("@form", form.getClientId(facesContext));
    }
    if(process.indexOf("@parent") != -1)
      process = process.replaceFirst("@parent", component.getParent().getClientId(facesContext));
View Full Code Here

   
    if(watermark.getFor() != null) {
      String _for = watermark.getFor()
      UIComponent forComponent = watermark.findComponent(_for);
      if(forComponent == null) {
        throw new FacesException("Cannot find component \"" + _for + "\" in view.");
      }
      target = ComponentUtils.escapeJQueryId(forComponent.getClientId(context));
     
    } else if(watermark.getForElement() != null) {
      target = watermark.getForElement();
    } else {
      throw new FacesException("Either for or forElement options must be used to define a watermark");
    }
   
    writer.startElement("script", null);
    writer.writeAttribute("type", "text/javascript", null);
   
View Full Code Here

    String selectionMode = dataTable.getSelectionMode();
   
    if(dataTable.isDynamic() || dataTable.getUpdate() != null) {
      UIComponent form = ComponentUtils.findParentForm(facesContext, dataTable);
      if(form == null) {
        throw new FacesException("DataTable : \"" + clientId + "\" must be inside a form element when dynamic data or ajax selection is enabled");
      }
     
      formClientId = form.getClientId(facesContext);
    }
   
View Full Code Here

    String onclick = button.getOnclick();
    if(!type.equals("reset") && !type.equals("button")) {
      UIComponent form = ComponentUtils.findParentForm(facesContext, button);
      if(form == null) {
        throw new FacesException("CommandButton : \"" + clientId + "\" must be inside a form element");
      }
     
      String formClientId = form.getClientId(facesContext);   
      String request = button.isAjax() ? buildAjaxRequest(facesContext, button, formClientId, clientId) : getNonAjaxRequest(facesContext, button, formClientId);
      onclick = button.getOnclick() != null ? button.getOnclick() + ";" + request : request;
View Full Code Here

   
    if(_for != null) {
      UIComponent forComponent = menu.findComponent(_for);
     
      if(forComponent == null)
        throw new FacesException("Cannot find component '" + _for + "' in view.");
      else {
        if(forComponent instanceof DataTable)
          return createUniqueWidgetVar(facesContext, forComponent) + ".getTbodyEl()";
        else
          return "'" +  forComponent.getClientId(facesContext) + "'";
View Full Code Here

TOP

Related Classes of javax.faces.FacesException

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.