I'm migrating from Richfaces 3.3.3 to 4.2 and I'm getting trouble with @ViewScoped.

On RF 3.3.3 it was fine for me to navigate from pageA.xhtml (list of entities) to pageB.xhtml (edit the entity) this way:

beanA

@KeepAlive

pageA.xhtml

on a datatable rowclick event, a jsFunction calls a method on beanB do get the id, populate beanB values, and return pageB.xhtml, like this:

<a4j:jsFunction name="jsFooName" action="#{beanB.edit}">

<f:param name="id" />

</a4j:jsFunction>

<rich:datatable value="#{beanA.someList}"

var="item"

onRowClick="jsFooName('#{item.id}');"

beanB

@KeepAlive

public String edit() {

// get id in the request

// read from database and populate beanB properties

return "pageB.xhtml"

}

It was fine, but NOW, changing from @KeepAlive to @ViewScoped, pageB.xhtml DO NOT show any values, just empty fields AND I need to click twice on a commandButton on pageB.xhtml to get back to pageA.xhtml (first click just blinks the page)