public void applyAttachedObject(FaceletContext faceletContext, UIComponent parent) { ClientBehaviorHolder holder = (ClientBehaviorHolder) parent; String eventName = getEventName(); if (null == eventName) { eventName = holder.getDefaultEventName(); if (null == eventName) { throw new TagException(this.tag, "Event attribute could not be determined: " + eventName); } } else { Collection<String> eventNames = holder.getEventNames(); if (!eventNames.contains(eventName)) { throw new TagException(this.tag, "Event:" + eventName + " is not supported."); } } ClientBehaviorBase behavior = createBehavior(faceletContext, eventName, parent); holder.addClientBehavior(eventName, behavior); }
throw new TagException(tag, "Composite component does not have BeanInfo attribute"); throw new TagException(tag, "Composite component BeanInfo does not have BeanDescriptor"); throw new TagException(tag, "Composite component does not support behavior events"); throw new TagException(tag, "Composite component does not support event " + eventName); throw new TagException(this.tag, "Unable to attach behavior to non-ClientBehaviorHolder parent");
@Override public void apply(FaceletContext faceletContext, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { if (parent == null || !ComponentHandler.isNew(parent)) { return; } if (parent instanceof ActionSource) { ValueExpression targetVE = target.getValueExpression(faceletContext, Object.class); ValueExpression clearModelVE = clearModel != null ? clearModel.getValueExpression(faceletContext, Boolean.class) : null; ActionSource actionSource = (ActionSource) parent; actionSource.addActionListener(new ResetInputActionListener(targetVE, clearModelVE)); } else { throw new TagException(tag, "ResetInput can only be attached to ActionSource components."); } }
protected void verifyNestClientBehaviorHolderAndOrCompositeComp( boolean isClientBehaviorHolder, boolean isCompositeComponent) { if (!isClientBehaviorHolder && !isCompositeComponent) { throw new TagException(this.tag, "Error: ace:ajax is nested in a parent that does not support behaviors"); } }
private void throwRequiredException(FaceletContext ctx, String facetName, UIComponent compositeParent) { throw new TagException(tag, "Unable to find facet named '" + facetName + "' in parent composite component with id '" + compositeParent .getClientId(ctx.getFacesContext()) + '\''); }
private void throwRequiredException(FaceletContext ctx, UIComponent compositeParent) { throw new TagException(tag, "Unable to find any children components " + "nested within parent composite component with id '" + compositeParent .getClientId(ctx.getFacesContext()) + '\''); }
protected final TagAttribute getRequiredPassthroughAttribute(String localName) throws TagException { TagAttribute attr = this.tag.getAttributes().get(PassThroughAttributeLibrary.Namespace, localName); if (attr == null) { throw new TagException(this.tag, "Attribute '" + localName + "' is required"); } return attr; }
private void throwRequiredException(FaceletContext ctx, String name, UIComponent compositeParent) { throw new TagException(this.tag, "Unable to find facet named '" + name + "' in parent composite component with id '" + compositeParent .getClientId(ctx.getFacesContext()) + '\''); }
private void throwRequiredException(FaceletContext ctx, String facetName, UIComponent compositeParent) { throw new TagException(tag, "Unable to find facet named '" + facetName + "' in parent composite component with id '" + compositeParent .getClientId(ctx.getFacesContext()) + '\''); }
private void throwRequiredException(FaceletContext ctx, String name, UIComponent compositeParent) { throw new TagException(this.tag, "Unable to find facet named '" + name + "' in parent composite component with id '" + compositeParent .getClientId(ctx.getFacesContext()) + '\''); }
private void throwRequiredException(FaceletContext ctx, UIComponent compositeParent) { throw new TagException(tag, "Unable to find any children components " + "nested within parent composite component with id '" + compositeParent .getClientId(ctx.getFacesContext()) + '\''); }
protected final TagAttribute getRequiredPassthroughAttribute(String localName) throws TagException { TagAttribute attr = this.tag.getAttributes().get(PassThroughAttributeLibrary.Namespace, localName); if (attr == null) { throw new TagException(this.tag, "Attribute '" + localName + "' is required"); } return attr; }
public BehaviorHandler(BehaviorConfig config) { super(config); this.behaviorId = config.getBehaviorId(); this.event = this.getAttribute("event"); if (null != event && !event.isLiteral()){ throw new TagException(this.tag, "The 'event' attribute for behavior tag must be a literal"); } }
public BehaviorHandler(BehaviorConfig config) { super(config); this.behaviorId = config.getBehaviorId(); this.event = this.getAttribute("event"); if (null != event && !event.isLiteral()){ throw new TagException(this.tag, "The 'event' attribute for behavior tag must be a literal"); } }
public BehaviorHandler(BehaviorConfig config) { super(config); this.behaviorId = config.getBehaviorId(); this.event = this.getAttribute("event"); if (null != event && !event.isLiteral()){ throw new TagException(this.tag, "The 'event' attribute for behavior tag must be a literal"); } }
public BehaviorHandler(BehaviorConfig config) { super(config); this.behaviorId = config.getBehaviorId(); this.event = this.getAttribute("event"); if (null != event && !event.isLiteral()){ throw new TagException(this.tag, "The 'event' attribute for behavior tag must be a literal"); } }
protected Behavior createBehavior(FaceletContext ctx) { if (_delegate.getBehaviorId() == null) { throw new TagException( _delegate.getTag(), "No behavior id defined"); } return ctx.getFacesContext().getApplication().createBehavior(_delegate.getBehaviorId()); }
protected Behavior createBehavior(FaceletContext ctx) { if (_delegate.getBehaviorId() == null) { throw new TagException( _delegate.getTag(), "No behavior id defined"); } return ctx.getFacesContext().getApplication().createBehavior(_delegate.getBehaviorId()); }
private String getEventName(ClientBehaviorHolder holder){ String eventName; if (null != owner.getEvent()){ eventName = owner.getEvent().getValue(); } else { eventName = holder.getDefaultEventName(); } if (null == eventName){ throw new TagException(owner.getTag(), "The event name is not defined"); } return eventName; }
private String getEventName(ClientBehaviorHolder holder){ String eventName; if (null != owner.getEvent()){ eventName = owner.getEvent().getValue(); } else { eventName = holder.getDefaultEventName(); } if (null == eventName){ throw new TagException(owner.getTag(), "The event name is not defined"); } return eventName; }