public void applyAttachedObject(FacesContext context, UIComponent parent) { FaceletContext ctx = (FaceletContext) context.getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY); // cast to the ClientBehaviorHolder. ClientBehaviorHolder behaviorHolder = (ClientBehaviorHolder) parent; ValueExpression bindingExpr=null; Behavior behavior=null; if (null != owner.getBinding()){ bindingExpr = owner.getBinding().getValueExpression(ctx, Behavior.class); behavior = (Behavior) bindingExpr.getValue(ctx); } if (null == behavior){ if (null != owner.getBehaviorId()){ behavior = ctx.getFacesContext().getApplication().createBehavior(owner.getBehaviorId()); if (null == behavior){ throw new TagException(owner.getTag(), "No Faces behavior defined for Id "+owner.getBehaviorId()); } if (null != bindingExpr){ bindingExpr.setValue(ctx, behavior); } } else { throw new TagException(owner.getTag(),"No behaviorId defined"); } } owner.setAttributes(ctx, behavior); if (behavior instanceof ClientBehavior) { behaviorHolder.addClientBehavior(getEventName(behaviorHolder), (ClientBehavior)behavior); } }
@Override public void applyAttachedObject(FacesContext context, UIComponent parent) { FaceletContext ctx = (FaceletContext) context.getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY); // cast to the ClientBehaviorHolder. ClientBehaviorHolder behaviorHolder = (ClientBehaviorHolder) parent; ValueExpression bindingExpr=null; Behavior behavior=null; if (null != owner.getBinding()){ bindingExpr = owner.getBinding().getValueExpression(ctx, Behavior.class); behavior = (Behavior) bindingExpr.getValue(ctx); } if (null == behavior){ if (null != owner.getBehaviorId()){ behavior = ctx.getFacesContext().getApplication().createBehavior(owner.getBehaviorId()); if (null == behavior){ throw new TagException(owner.getTag(), "No Faces behavior defined for Id "+owner.getBehaviorId()); } if (null != bindingExpr){ bindingExpr.setValue(ctx, behavior); } } else { throw new TagException(owner.getTag(),"No behaviorId defined"); } } owner.setAttributes(ctx, behavior); if (behavior instanceof ClientBehavior) { behaviorHolder.addClientBehavior(getEventName(behaviorHolder), (ClientBehavior)behavior); } }
@Override public void applyAttachedObject(FacesContext context, UIComponent parent) { FaceletContext ctx = (FaceletContext) context.getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY); // cast to the ClientBehaviorHolder. ClientBehaviorHolder behaviorHolder = (ClientBehaviorHolder) parent; ValueExpression bindingExpr=null; Behavior behavior=null; if (null != owner.getBinding()){ bindingExpr = owner.getBinding().getValueExpression(ctx, Behavior.class); behavior = (Behavior) bindingExpr.getValue(ctx); } if (null == behavior){ if (null != owner.getBehaviorId()){ behavior = ctx.getFacesContext().getApplication().createBehavior(owner.getBehaviorId()); if (null == behavior){ throw new TagException(owner.getTag(), "No Faces behavior defined for Id "+owner.getBehaviorId()); } if (null != bindingExpr){ bindingExpr.setValue(ctx, behavior); } } else { throw new TagException(owner.getTag(),"No behaviorId defined"); } } owner.setAttributes(ctx, behavior); if (behavior instanceof ClientBehavior) { behaviorHolder.addClientBehavior(getEventName(behaviorHolder), (ClientBehavior)behavior); } }
@Override public void applyAttachedObject(FacesContext context, UIComponent parent) { FaceletContext ctx = (FaceletContext) context.getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY); // cast to the ClientBehaviorHolder. ClientBehaviorHolder behaviorHolder = (ClientBehaviorHolder) parent; ValueExpression bindingExpr=null; Behavior behavior=null; if (null != owner.getBinding()){ bindingExpr = owner.getBinding().getValueExpression(ctx, Behavior.class); behavior = (Behavior) bindingExpr.getValue(ctx); } if (null == behavior){ if (null != owner.getBehaviorId()){ behavior = ctx.getFacesContext().getApplication().createBehavior(owner.getBehaviorId()); if (null == behavior){ throw new TagException(owner.getTag(), "No Faces behavior defined for Id "+owner.getBehaviorId()); } if (null != bindingExpr){ bindingExpr.setValue(ctx, behavior); } } else { throw new TagException(owner.getTag(),"No behaviorId defined"); } } owner.setAttributes(ctx, behavior); if (behavior instanceof ClientBehavior) { behaviorHolder.addClientBehavior(getEventName(behaviorHolder), (ClientBehavior)behavior); } }
_delegate.setAttributes(faceletContext, behavior);
_delegate.setAttributes(faceletContext, behavior);
_delegate.setAttributes(faceletContext, behavior);