JBoss.org Community Documentation

- Prev
- Next

## 6.89. < rich:nodeSelectListener >

### 6.89.1. Description

The <rich:nodeSelectListener> represents an action listener method that is notified after selection of a node.

### 6.89.2. Key Features

- Allows to define some "nodeSelect" listeners for the component

Table 6.483. rich : nodeSelectListener attributes

Attribute Name | Description
--- | ---
binding | The attribute takes a value-binding expression for a component property of a backing bean

Table 6.484. Component identification parameters

Name | Value
--- | ---
listener-class | org.richfaces.event.NodeSelectedListener
event-class | org.richfaces.event.NodeSelectedEvent
tag-class | org.richfaces.taglib.NodeSelectListenerTag

### 6.89.3. Creating the Component with a Page Tag

To create the simplest variant on a page use the following syntax:

Example:

    ...

        <rich:nodeSelectListener type="demo.Bean"/>

    ...

### 6.89.4. Creating the Component Dynamically Using Java

Example:

    package demo;

    public class ImplBean implements org.richfaces.event.NodeSelectListener{

        ...

    }

    import demo.ImplBean;

    ...

    ImplBean myListener = new ImplBean();

    ...

### 6.89.5. Details of Usage

The <rich:nodeSelectListener> is used as a nested tag with <rich:tree> and <rich:treeNode> components.

Attribute "type" defines the fully qualified Java class name for listener. This class should implement `org.richfaces.event.NodeSelectedListener` interface.

The typical variant of using:

    ...

    <rich:tree switchType="server" value="#{project.data}" var="item" nodeFace="#{item.type}">

        <rich:nodeSelectListener type="demo.ListenerBean"/>

        ...

        <!-- Tree nodes -->

        ...

    </rich:tree>

    ...

Java bean source:

    package demo;

    import org.richfaces.event.NodeSelectedEvent;

    public class ListenerBean implements org.richfaces.event.NodeSelectedListener{

    ...

        public void processSelection(NodeSelectedEvent arg0){

            //Custom Developer Code

        }

    ...

    }

### 6.89.6. Look-and-Feel Customization

<rich:nodeSelectListener> has no skin parameters and custom style classes, as the component isn't visual.

- Prev6.88. < rich:changeExpandListener > ...
- Top of page
- Front page
- Next6.90. < rich:recursiveTreeNodesAdaptor ...