void handleMethodNotFoundException(TemplateContext context) throws MethodNotFoundException {
   MethodCallElement._log.error(
       Messages.getMessage(
           Messages.METHOD_CALL_ERROR_5a, methodName, context.getComponent().getId()));
   throw new MethodNotFoundException(
       Messages.getMessage(Messages.METHOD_CALL_ERROR_6a, methodName));
 }
 void handleIllegalAccessException(TemplateContext context, IllegalAccessException e) {
   MethodCallElement._log.error(
       Messages.getMessage(
           Messages.METHOD_CALL_ERROR_3a, methodName, context.getComponent().getId()),
       e);
   throw new FacesException(
       Messages.getMessage(
           Messages.METHOD_CALL_ERROR_4a,
           new Object[] {methodName, context.getComponent().getId(), e.getCause().getMessage()}),
       e);
 }
 @Override
 public void setValueExpression(String name, ValueExpression binding) {
   // var - not allowed name. must be literal.
   if ("var".equals(name)) {
     throw new FacesException(
         Messages.getMessage(Messages.VAR_MUST_BE_LITERAL, getClientId(getFacesContext())));
   }
   if ("event".equals(name)) {
     throw new FacesException(
         Messages.getMessage(Messages.EVENT_MUST_BE_LITERAL, getClientId(getFacesContext())));
   }
   super.setValueExpression(name, binding);
 }
 void handleIllegalAccessException(TemplateContext context, IllegalAccessException e) {
   String logMessage =
       (utils)
           ? Messages.getMessage(
               Messages.getMessage(
                   Messages.METHOD_CALL_ERROR_3, methodName, context.getComponent().getId()))
           : Messages.getMessage(
               Messages.getMessage(
                   Messages.METHOD_CALL_ERROR_3a, methodName, context.getComponent().getId()));
   String excMessage =
       (utils)
           ? Messages.getMessage(
               Messages.getMessage(
                   Messages.METHOD_CALL_ERROR_4,
                   new Object[] {
                     methodName, context.getComponent().getId(), e.getCause().getMessage()
                   }))
           : Messages.getMessage(
               Messages.getMessage(
                   Messages.METHOD_CALL_ERROR_4a,
                   new Object[] {
                     methodName, context.getComponent().getId(), e.getCause().getMessage()
                   }));
   MethodCallElement._log.error(logMessage, e);
   throw new FacesException(excMessage, e);
 }
Exemple #5
0
  protected void processDecodes(FacesContext faces, Object argument) {
    if (!this.isRendered()) return;
    this.decode(faces);

    SubmittedValue submittedValue = UIOrderingList.this.submittedValueHolder;
    if (submittedValue != null) {
      Object modelValue = getValue();
      Iterator iterator = submittedValue.dataMap.entrySet().iterator();
      while (iterator.hasNext()) {
        Entry entry = (Entry) iterator.next();
        Object value = entry.getValue();

        if (!isSuitableValue(modelValue, value)) {
          String messageText =
              Messages.getMessage(Messages.INVALID_VALUE, MessageUtil.getLabel(faces, this), value);

          FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, messageText, null);
          faces.addMessage(this.getClientId(faces), message);

          setValid(false);
          break;
        }
      }
    }

    this.iterate(faces, decodeVisitor, argument);

    if (isImmediate()) {
      executeValidate(faces);
    }

    if (!isValid()) {
      faces.renderResponse();
    }
  }
 public void setParentProperties(UIComponent parent) {
   ValueExpression valueBinding;
   if (null != getEvent()) {
     if (log.isDebugEnabled()) {
       log.debug(Messages.getMessage(Messages.SET_VALUE_BINDING_FOR_EVENT, getEvent()));
     }
     // for non action/data components, or for non-default events - build
     // listener for this instance.
     valueBinding = getEventValueBinding();
     parent.setValueExpression(getEvent(), valueBinding);
   }
 }
 /**
  * After nornal setting <code>parent</code> property in case of created component set Ajax
  * properties for parent.
  *
  * @see javax.faces.component.UIComponentBase#setParent(javax.faces.component.UIComponent)
  */
 public void setParent(UIComponent parent) {
   super.setParent(parent);
   if (null != parent && parent.getFamily() != null) {
     if (log.isDebugEnabled()) {
       log.debug(Messages.getMessage(Messages.CALLED_SET_PARENT, parent.getClass().getName()));
     }
     // TODO If this comopnent configured, set properties for parent
     // component.
     // NEW created component have parent, restored view - null in My
     // faces.
     // and SUN RI not call at restore saved view.
     // In other case - set in restoreState method.
     // if (parent.getParent() != null)
     {
       if (log.isDebugEnabled()) {
         log.debug(Messages.getMessage(Messages.DETECT_NEW_COMPONENT));
       }
       setParentProperties(parent);
     }
   }
 }
 void handleMethodNotFoundException(TemplateContext context) throws MethodNotFoundException {
   String logMessage =
       (utils)
           ? Messages.getMessage(
               Messages.getMessage(
                   Messages.METHOD_CALL_ERROR_5, methodName, context.getComponent().getId()))
           : Messages.getMessage(
               Messages.getMessage(
                   Messages.METHOD_CALL_ERROR_5a, methodName, context.getComponent().getId()));
   String excMessage =
       (utils)
           ? Messages.getMessage(Messages.getMessage(Messages.METHOD_CALL_ERROR_6, methodName))
           : Messages.getMessage(Messages.getMessage(Messages.METHOD_CALL_ERROR_6a, methodName));
   MethodCallElement._log.error(logMessage);
   throw new FacesException(excMessage);
 }
 /**
  * Create Special <code>ValueBinding</code> for build JavaScrept event code in parent component
  * from this.
  *
  * @return <code>EventValueBinding</code> based on properties of current component
  */
 private ValueExpression getEventValueBinding() {
   if (log.isDebugEnabled()) {
     log.debug(Messages.getMessage(Messages.CREATE_JAVASCRIPT_EVENT, getId()));
   }
   return new EventValueExpression(this);
 }
 InvokeData invokeMethod(TemplateContext context, MethodCacheState state) {
   throw new FacesException(Messages.getMessage(Messages.RENDERER_METHOD_NOT_SET_ERROR));
 }
 /* (non-Javadoc)
  * @see org.ajax4jsf.renderkit.compiler.ElementBase#setParent(org.ajax4jsf.renderkit.compiler.PreparedTemplate)
  */
 public void setParent(PreparedTemplate parent) throws SAXException {
   super.setParent(parent);
   if (getName() == null) {
     throw new SAXException(Messages.getMessage(Messages.NO_NAME_ATTRIBUTE_ERROR, getTag()));
   }
 }