-
1. Re: Richfaces4 richfaces css lost between 2 pages
pvito Nov 23, 2011 8:09 AM (in response to totoranky)Hi Antony, this works for me:
test1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich">
<h:head></h:head>
<h:body >
<h:form>
<h:commandLink action="test2?faces-redirect=true" value="Go To test 2"/>
<rich:panel header="test">
test text
</rich:panel>
</h:form>
</h:body>
</html>
test2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich">
<h:head></h:head>
<h:body >
<h:form>
<h:commandLink action="test1?faces-redirect=true" value="Back To test 1" />
<rich:panel header="test" >
test text
</rich:panel >
</h:form>
</h:body>
</html>
-
2. Re: Richfaces4 richfaces css lost between 2 pages
totoranky Nov 23, 2011 2:50 PM (in response to pvito)Vitaliy,
thanks for your reply, and it works fine indeed, but I don't understand why do we need redirect here.
Now with JSF2 h:command generates an ajax request, so I think just some parts of the page are regenerated,
so why the css imports are rerender ??
anyway, you give me a first solution.
-
3. Re: Richfaces4 richfaces css lost between 2 pages
pvito Nov 24, 2011 1:36 AM (in response to totoranky)Hi, Antony Antony.
For ajax you must use a4j:commandLink.
See this sample :http://richfaces-showcase.appspot.com/richfaces/component-sample.jsf?demo=commandLink&skin=blueSky
-
4. Re: Richfaces4 richfaces css lost between 2 pages
totoranky Nov 24, 2011 3:57 AM (in response to pvito)you are right,
h:commandLink does not generate ajax submit but only single javascript submission with the onClick a attribute.
Anyway my opinion is still the same, normally, we don't need redirect here to just keep css between 2 pages.
I got a better way to reproduce the problem (you don't need to have exactly same code on both pages), in both pages you just need to put a rich:panel at the same place.
The first will be well displayed after clicking on the link to go on the second page, this panel will be present but withoutall richfaces layout (due to the missing css file impot).
-
5. Re: Richfaces4 richfaces css lost between 2 pages
pvito Nov 24, 2011 6:24 AM (in response to totoranky)Could you please give your full source code ?
-
6. Re: Richfaces4 richfaces css lost between 2 pages
totoranky Nov 24, 2011 8:14 AM (in response to pvito)My code is the single example I previously showed
my web.xml
<web-app xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<!-- Faces Servlet -->
−
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Faces Servlet Mapping -->
−
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
−
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<!-- Login and file extensions -->
−
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
−
<!-- Rich faces mapping -->
−
<context-param>
<param-name>org.richfaces.skin</param-name>
<param-value>blueSky</param-value>
</context-param>
</web-app>
and the faces-config is totally empty.
I think you experienced the same thing because on your example you used the faces-redirect=true, so without it I suppose you can see the same odd behavior, two rich:panel in two successive pages the second will not be displayed with richfaces css.
If you have a look in the html source code the second header page will not have this css import
<link href="/school/rfRes/panel.ecss.faces?db=eAHL6rC8BQAEkAIG&ln=org.richfaces" rel="stylesheet" type="text/css">
and why ??? that's I can't understand
-
7. Re: Richfaces4 richfaces css lost between 2 pages
pvito Nov 24, 2011 8:56 AM (in response to totoranky)In your first example h:commandLink is not placed in <h:form></h:form>.
It's works for me without redirect.
Css is importing into both pages.
test1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich">
<h:head></h:head>
<h:body >
<h:form>
<h:commandLink action="test2" value="Go To test 2"/>
<rich:panel header="test">
test text
</rich:panel>
</h:form>
</h:body>
</html>
test2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich">
<h:head></h:head>
<h:body >
<h:form>
<h:commandLink action="test1" value="Back To test 1" />
<rich:panel header="test" >
test text
</rich:panel >
</h:form>
</h:body>
</html>
-
8. Re: Richfaces4 richfaces css lost between 2 pages
totoranky Nov 24, 2011 5:35 PM (in response to pvito)I just tested with new jars, but I still get same result, my panel is displayed without css layout
css is not imported in the header in the second page
-
9. Re: Richfaces4 richfaces css lost between 2 pages
pvito Nov 25, 2011 1:47 AM (in response to totoranky)I can't reproduce your issue.
Could you please give me your wholly project?
-
10. Re: Richfaces4 richfaces css lost between 2 pages
totoranky Nov 27, 2011 5:41 AM (in response to pvito)Hi Vitaliy,
Sorry for my late reply, it was the time to test different changes. When you told me your configuration worked,
I thought my setting had something wrong. I use maven to get my libraries, so I strated from an hello world JSF 2 project
without maven and I noticed everything was working.
So I replaced all my maven libraries one by one and I figured out my problem, it was jsf-api and jsf-impl beta libraries.
I found the newest pom declaration on the web and now it's good with my maven project.
So thanks for all your help.