-
1. form and "rendered" problem
chapirous Feb 21, 2011 4:45 PM (in response to chalu)What is the scope of your bean?
If request scope, you need to save the state of the bean using <a4j:keepAlive/> or save the state of the Boolean attribute using <t:saveState/> or extend the scope of your bean.
-
2. form and "rendered" problem
chalu Feb 21, 2011 5:10 PM (in response to chapirous)extending the scope causes much more problems...
The mbean is request scope. Some data are stored in session and mbean manage these data (save, erase from session, change data etc.)
If I change the scope to session, then:
- pressing button causes
22:59:48,756 ERROR [STDERR] java.lang.IllegalStateException
22:59:48,756 ERROR [STDERR] at com.sun.faces.context.FacesContextImpl.assertNotReleased(FacesContextImpl.java:395)
22:59:48,756 ERROR [STDERR] at com.sun.faces.context.FacesContextImpl.getExternalContext(FacesContextImpl.java:147)
22:59:48,756 ERROR [STDERR] at cz.chalu.hrp.faces.BaseServlet.getResponse(BaseServlet.java:32)
where cointains code:
(HttpServletRequest)getContext().getExternalContext().getRequest();
next,
Caused by: java.lang.NullPointerException
at org.apache.catalina.connector.Request.setAttribute(Request.java:1443)
at org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:503)
at cz.chalu.hrp.faces.BaseServlet.storeErrorMessage(BaseServlet.java:72)
where
protected void storeErrorMessage(String messageKey){
errorMessage = mf.getMessage(messageKey);
getRequest().setAttribute("errorMessage", errorMessage);
}
code is.
And next problem is, that when I want to load another profile with another data, data from the first profile is displayed.
So generally, I dont like this way very much, looks that extracting this form from this page is better. But, is there what I understand wrong, eg. if I use something by wrong way?
-
3. form and "rendered" problem
chapirous Feb 21, 2011 9:42 PM (in response to chalu)What versions are you using?
Rich 3.x and JSF1.2, rich 3.3 and JSF2 or rich4 and JSF2?
-
4. form and "rendered" problem
chalu Feb 22, 2011 2:38 AM (in response to chapirous)Rich 3.3.3 and JSF 1.2:
2011-02-21 19:54:03,386 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (main) deploy, ctxPath=/
2011-02-21 19:54:03,612 INFO [javax.enterprise.resource.webcontainer.jsf.config] (main) Initializing Mojarra (1.2_12-b01-FCS) for context ''
2011-02-21 19:54:10,071 WARN [org.ajax4jsf.webapp.BaseXMLFilter] (main) This version of RichFaces implementation compatible for JSF2.0, but running under JSF1.2
I tried to switch to JSF2.0, but didn't find the way, still have this log message.
-
5. form and "rendered" problem
ilya_shaikovsky Feb 22, 2011 4:04 AM (in response to chalu)1) rendered should be kept between requests so you have to deal with the other problems. Maybe just expose the view properties to separate session scoped controller and remain the data in request.
2)
2011-02-21 19:54:10,071 WARN [org.ajax4jsf.webapp.BaseXMLFilter] (main) This version of RichFaces implementation compatible for JSF2.0, but running under JSF1.2
which richfaces-impl you added? for JSF 2 you should add the only richfaces-impl-jsf2.jar and not the richfaces-impl. (Both also should not be added.)
-
6. form and "rendered" problem
chalu Feb 22, 2011 5:52 PM (in response to ilya_shaikovsky)hmmm
ok. I switched application to JSF 2.0, but for this, I had to use JBoss 6.
JBoss 5.1 server with my application started at 1 minute, JBoss 6 with my app needs 10 minutes. I do not understand what happens with small light application server ... but it is not for this phorum, sorry.
So I will return to JSF 1.2, even some things are not working, eg. navigation. Maybe when RF4 will be done, maybe with some new version of JBoss...
OK, thank you
Jiri
-
7. form and "rendered" problem
nbelaevski Feb 22, 2011 11:25 PM (in response to chalu)Hi Jiri,
You are calling FacesContext methods after it has been released from inside your servlet. Why use FacesContext? Call Servlet API directly.