-
1. Re: Problem with ViewScoped JSF2 and render Richfaces 4.2
sunkaram Mar 22, 2012 1:36 PM (in response to rogerionj)action method should return null to make use of viewscoped bean, else new instance will be created everytime..
change methods to
public
String teste1(){
testeStr = "teste1";
System.out.println("Teste1");return null;
}
public String teste2(){
testeStr = "teste2";
System.out.println("Teste2");return null;
} -
2. Re: Problem with ViewScoped JSF2 and render Richfaces 4.2
rogerionj Mar 22, 2012 2:09 PM (in response to sunkaram)Not resolved.
behavior remains the same:
Construct
Teste1
Construct
in console
-
3. Re: Problem with ViewScoped JSF2 and render Richfaces 4.2
sunkaram Mar 22, 2012 2:15 PM (in response to rogerionj)I don't see any other issues.. make sure its deployed properly.. add few more debug statements to confirm..
-
4. Re: Problem with ViewScoped JSF2 and render Richfaces 4.2
rogerionj Mar 22, 2012 2:18 PM (in response to sunkaram)When I use 1 <h:form> works.
Richfaces 4 bug will be? -
5. Re: Problem with ViewScoped JSF2 and render Richfaces 4.2
sunkaram Mar 22, 2012 2:35 PM (in response to rogerionj)these type of problems you can see if you re-render forms.. always try to render just content of the form where possible..
-
6. Re: Problem with ViewScoped JSF2 and render Richfaces 4.2
rogerionj Mar 22, 2012 2:44 PM (in response to sunkaram)I tried inserir ID on form for test
Not resolved.
In Richfaces 3.3.X it worked, so I think that is bug in Richfaces 4
-
7. Re: Problem with ViewScoped JSF2 and render Richfaces 4.2
sunkaram Mar 22, 2012 2:57 PM (in response to rogerionj)why did you assign a ID to form? Don't try to render form itself.. render only inner contents. below code should work..
<rich:panel>
<h:form><h:panelGroup id="button1">
<a4j:outputPanel rendered="#{teste.testeStr == 'teste2' or teste.testeStr == null}">
<a4j:commandButton value="Teste1" action="#{teste.teste1}" render="button,button2,results"/>
</a4j:outputPanel></h:panelGroup>
</h:form><h:form>
<h:panelGroup id="button2">
<a4j:outputPanel rendered="#{teste.testeStr == 'teste1' or teste.testeStr == null}">
<a4j:commandButton value="Teste2" action="#{teste.teste2}" render="button,button2,results"/>
</a4j:outputPanel></h:panelGroup>
</h:form><h:panelGroup id="results">
<a4j:outputPanel rendered="#{teste.testeStr == null}">
oi
</a4j:outputPanel>
<h:outputText value="#{teste.testeStr}"/>
</h:panelGroup>
</rich:panel> -
8. Re: Problem with ViewScoped JSF2 and render Richfaces 4.2
rogerionj Mar 22, 2012 3:07 PM (in response to sunkaram)It worked!
Thank you very much!!Saved one job hehehe