Send your remarks, comments or wishes to doc team
Subject:
Message:
Your name:
Your email:

JBoss.org Community Documentation

- Prev
- Next

## 6.94. < rich:changeExpandListener >

### 6.94.1. Description

The <rich:changeExpandListener> represents an action listener method that is notified on an expand/collapse event on the node.

### 6.94.2. Key Features

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

Table 6.517. rich : changeExpandListener attributes

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

Table 6.518. Component identification parameters

Name | Value
--- | ---
listener-class | org.richfaces.event.NodeExpandedListener
event-class | org.richfaces.event.NodeExpandedEvent
tag-class | org.richfaces.taglib.ChangeExpandListenerTag

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

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

Example:

    ...

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

    ...

### 6.94.4. Creating the Component Dynamically Using Java

Example:

    package demo;

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

        ...

    }

    import demo.ImplBean;

    ...

    ImplBean myListener = new ImplBean();

    ...

### 6.94.5. Details of Usage

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

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

The typical variant of using:

    ...

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

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

        ...

        <!-- Tree nodes -->

        ...

    </rich:tree>

    ...

Java bean source:

    package demo;

    import org.richfaces.event.NodeExpandedEvent;

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

    ...

        public void processExpansion(NodeExpandedEvent arg0){

            //Custom Developer Code

        }

    ...

    }

    ...

### 6.94.6. Look-and-Feel Customization

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

- Prev6.93. < rich:treeNode >
- Top of page
- Front page
- Next6.95. < rich:nodeSelectListener >