public int doStartTag() throws JspException { UIComponentTag tag = UIComponentTag .getParentUIComponentTag(pageContext); if (tag == null) { throw new JspException("Not nested in a UIComponentTag"); } if (!tag.getCreated()) { return EVAL_PAGE; } Converter converter = createConverter(); UIComponent component = tag.getComponentInstance(); if (component == null || !(component instanceof ValueHolder)) { throw new JspException( "Component is null or not editable value holder."); } ValueHolder valueHolder = (ValueHolder) component; valueHolder.setConverter(converter); pageContext.setAttribute(ExtensionConstants.CONVERTER_STACK_ATTR, converter, PageContext.REQUEST_SCOPE); return EVAL_BODY_BUFFERED; }
public int doStartTag() throws javax.servlet.jsp.JspException { UIComponentTag componentTag = UIComponentTag.getParentUIComponentTag(pageContext); if (componentTag == null) { throw new JspException("no parent UIComponentTag found"); } if (!componentTag.getCreated()) { return Tag.SKIP_BODY; } Validator validator = createValidator(); UIComponent component = componentTag.getComponentInstance(); if (component == null) { throw new JspException("parent UIComponentTag has no UIComponent"); } if (!(component instanceof EditableValueHolder)) { throw new JspException("UIComponent is no ValueHolder"); } ((EditableValueHolder)component).addValidator(validator); return Tag.SKIP_BODY; }
public int doStartTag() throws JspException { UIComponentTag tag = UIComponentTag .getParentUIComponentTag(pageContext); if (tag == null) { throw new JspException("Not nested in a UIComponentTag"); } if (!tag.getCreated()) { return EVAL_PAGE; } Validator validator = createValidator(); UIComponent component = tag.getComponentInstance(); if (component == null || !(component instanceof EditableValueHolder)) { throw new JspException( "Component is null or not editable value holder."); } EditableValueHolder editableValueHolder = (EditableValueHolder) component; editableValueHolder.addValidator(validator); pageContext.setAttribute(ExtensionConstants.VALIDATOR_STACK_ATTR, validator, PageContext.REQUEST_SCOPE); return EVAL_BODY_BUFFERED; }
public int doStartTag() throws JspException { UIComponentTag tag = UIComponentTag .getParentUIComponentTag(pageContext); if (tag == null) { throw new JspException("Not nested in a UIComponentTag"); } if (!tag.getCreated()) { return EVAL_PAGE; } Validator validator = createValidator(); UIComponent component = tag.getComponentInstance(); if (component == null || !(component instanceof EditableValueHolder)) { throw new JspException( "Component is null or not editable value holder."); } EditableValueHolder editableValueHolder = (EditableValueHolder) component; editableValueHolder.addValidator(validator); return SKIP_BODY; }
@Override public int doStartTag() throws JspException { UIComponentTag componentTag = UIComponentTag.getParentUIComponentTag(pageContext); if (componentTag == null) { throw new JspException("no parent UIComponentTag found"); } if (!componentTag.getCreated()) { return Tag.SKIP_BODY; } Validator validator = createValidator(); UIComponent component = componentTag.getComponentInstance(); if (component == null) { throw new JspException("parent UIComponentTag has no UIComponent"); } if (!(component instanceof EditableValueHolder)) { throw new JspException("UIComponent is no ValueHolder"); } ((EditableValueHolder)component).addValidator(validator); return Tag.SKIP_BODY; }
public int doStartTag() throws JspException { if (method == null) { throw new JspException("name attribute not set"); } // Find parent UIComponentTag UIComponentTag componentTag = UIComponentTag .getParentUIComponentTag(pageContext); if (componentTag == null) { throw new JspException( "ValueChangeListenerTag has no UIComponentTag ancestor"); } if (componentTag.getCreated()) { // Component was just created, so we add the Listener UIComponent component = componentTag.getComponentInstance(); if (component instanceof EditableValueHolder) { setupClassListener(component); } else { throw new JspException("Component " + component.getId() + " is no EditableValueHolder"); } } return Tag.SKIP_BODY; }
public int doStartTag() throws JspException { UIComponentTag componentTag = UIComponentTag .getParentUIComponentTag(pageContext); if (componentTag == null) { throw new JspException("Not nested in a UIComponentTag"); } if (!componentTag.getCreated()) { return Tag.SKIP_BODY; } UIComponent component = componentTag.getComponentInstance(); if (component instanceof ActionSource) { String className = getActionListenerClassName(); ActionListener actionListener = createActionListener(className); ((ActionSource) component).addActionListener(actionListener); } else { throw new JspException("Component:" + component + " is not instance of ActionSource"); } return Tag.SKIP_BODY; }
if (!componentTag.getCreated())
if (componentTag.getCreated())
if (componentTag.getCreated())
if (componentTag.getCreated()) {
if (parentComponentTag.getCreated())
if (componentTag.getCreated())
public int doStartTag() throws JspException { UIComponentTag tag = UIComponentTag .getParentUIComponentTag(pageContext); if (tag == null) { throw new JspException("No nested in UIComponentTag"); } if (!tag.getCreated()) { return (SKIP_BODY); } Converter converter = createConverter(); UIComponent component = tag.getComponentInstance(); if (component == null || !(component instanceof ValueHolder)) { throw new JspException("Component is null or not value holder."); } ValueHolder valueHolder = (ValueHolder) component; valueHolder.setConverter(converter); Object localValue = valueHolder.getLocalValue(); if (localValue instanceof String) { try { String str = (String) localValue; FacesContext context = WebAppUtil.getFacesContext(); localValue = converter.getAsObject(context, component, str); valueHolder.setValue(localValue); } catch (ConverterException e) { JspException ex = new JspException(e); throw ex; } } return SKIP_BODY; }
throw new JspException("Not nested in a UIComponentTag"); if (!tag.getCreated()) { return SKIP_BODY;
public int doEndTag() throws JspException { UIComponentTag tag = UIComponentTag .getParentUIComponentTag(pageContext); if (tag == null) { throw new JspException("Not nested in a UIComponentTag"); } if (!tag.getCreated()) { return EVAL_PAGE; } UIComponent component = tag.getComponentInstance(); Object attribute = pageContext.getAttribute( ExtensionConstants.CONVERTER_STACK_ATTR, PageContext.REQUEST_SCOPE); if (attribute instanceof Converter) { Converter converter = (Converter) attribute; UIParameterUtil.saveParametersToInstance(component, converter); } pageContext.removeAttribute(ExtensionConstants.CONVERTER_STACK_ATTR, PageContext.REQUEST_SCOPE); return super.doEndTag(); }
public int doEndTag() throws JspException { UIComponentTag tag = UIComponentTag .getParentUIComponentTag(pageContext); if (tag == null) { throw new JspException("Not nested in a UIComponentTag"); } if (!tag.getCreated()) { return EVAL_PAGE; } UIComponent component = tag.getComponentInstance(); Object attribute = pageContext.getAttribute( ExtensionConstants.VALIDATOR_STACK_ATTR, PageContext.REQUEST_SCOPE); if (attribute instanceof Validator) { Validator validator = (Validator) attribute; UIParameterUtil.saveParametersToInstance(component, validator); } pageContext.removeAttribute(ExtensionConstants.VALIDATOR_STACK_ATTR, PageContext.REQUEST_SCOPE); return super.doEndTag(); }
if (componentTag.getCreated())