// Fields
public int doStartTag() throws JspException {
UIComponentTag parentTag = UIComponentTag
.getParentUIComponentTag(pageContext);
if (parentTag == null) {
throw new JspException(Messages.getMessage(
Messages.NO_UI_COMPONENT_TAG_ANCESTOR_ERROR, this
.getClass().getName()));
}
if (type == null && binding == null) {
throw new JspException("Either of the following attributes is "
+ "required: type binding");
}
// Process only newly created components
if (parentTag.getCreated()) {
FacesContext context = FacesContext.getCurrentInstance();
Application application = context.getApplication();
org.richfaces.event.NodeSelectedListener listener = null;
UIComponent component = parentTag.getComponentInstance();
// First try to access listener binding
if (binding != null) {
ValueBinding valueBinding = application
.createValueBinding(binding);