richfaces keepAlive not working
- by Jurgen H
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
}