richfaces keepAlive not working

Posted by Jurgen H on Stack Overflow See other posts from Stack Overflow or by Jurgen H
Published on 2010-02-15T15:34:04Z Indexed on 2010/03/15 15:09 UTC
Read the original article Hit count: 261

Filed under:
|
|
|
|

I have a mediaOutput tag which, in its createContent attribute, requires the backing bean to be in a certain state. A list of values, which is filled in an init method, must be available.

I therefore added a keepAlive tag for the whole backing bean. I now indeed see the backingBean in stead of some (richfaces) proxy bean, but the filled list is null again.

How to make this possible?

I checked that the init method was called and that the list is filled in in the init method.

<a4j:keepAlive beanName="myBean" />
<a4j:mediaOutput createContent="#{myBean.writeChart}" ... />

The backing bean

public class MyBean implements Serializable {

public List list;

public void init(ActionEvent event) {
   // call some resource to fill the list
   list = service.getItems();
}

public void writeChart(final OutputStream out, final Object data) throws IOException {
   // list is null
}

// getters & setters
}

© Stack Overflow or respective owner

Related posts about a4j

Related posts about savestate