Note that there are some explanatory texts on larger screens.

plurals
  1. POProblems with page layout after migrating to JSF 2.0, RichFaces 4.1.0 Final
    text
    copied!<p>I have updated my project to richfaces 4.1.0 and JSF 2.0. I have abviously changed the maven dependencies, updated web.xml, faces-config.xml, swtiched from *.jsp files to *.xhtml files, updated all head,body,form to h:head, h:body, h:form. However, I have significant problems with my page layout and a4j:ajax behavior. I think that it's best if I just list the problems:</p> <ul> <li><p>My rich:datatable skin stopped working. I even tried deleting the columnClass etc. attributes from the tag to leave it with default bluesky skin, but the outcome looks just like a plain html table (no lines, no background, no colors).</p></li> <li><p>the a4j:axjax tag works much worse thatn a4j:support did. For my selectOneMenus I tried event="change" but it doesn't work. Only after adding a valueChangedListener to the tags and tried event="valueChange" it worked. </p></li> <li><p>rich:calendar elements are not 'clickable' - when I move the coursor over the button to popup the calendar it's not changing and when I click on the button nothing happens. I also need the a4j:ajax here but am not able to test it.</p></li> <li><p>Although event="valueChange" worked on selectOneMenu, my a4j:mediaOutput image is not re-rendered. And the chart was the reason why I switched to JSF 2.0 because I needed to use the session-data-helper mechanism to load the images. Is there a special mechanism to rerender (or now 'render' with a4j:ajax) this element when it's using the session-data-helper for loading data?</p></li> </ul> <p>Here are the web.xml and index.xhtml files:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"&gt; &lt;display-name&gt;presentation graph&lt;/display-name&gt; &lt;context-param&gt; &lt;param-name&gt;javax.faces.FACELETS_LIBRARIES&lt;/param-name&gt; &lt;param-value&gt;/WEB-INF/data-helper.taglib.xml&lt;/param-value&gt; &lt;/context-param&gt; &lt;context-param&gt; &lt;param-name&gt;javac.faces.PROJECT_STAGE&lt;/param-name&gt; &lt;param-value&gt;Development&lt;/param-value&gt; &lt;/context-param&gt; &lt;context-param&gt; &lt;param-name&gt;org.richfaces.SKIN&lt;/param-name&gt; &lt;param-value&gt;blueSky&lt;/param-value&gt; &lt;/context-param&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;index.xhtml&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;servlet&gt; &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt; &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt; &lt;url-pattern&gt;*.xhtml&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt; &lt;url-pattern&gt;*.faces&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;/web-app&gt; </code></pre> <p>index.xhtml</p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:sdh="http://richfaces.org/session-data-helper"&gt; &lt;h:head&gt; &lt;title&gt;Graph presentation&lt;/title&gt; &lt;h:outputStylesheet name="style.css" library="css" /&gt; &lt;/h:head&gt; &lt;h:body&gt; &lt;h:form id="form"&gt; &lt;div class="grid_2"&gt; &lt;rich:calendar value="#{formBean.date}" id="date" popup="true" datePattern="yyyy/MM/dd" showApplyButton="false" cellWidth="24px" cellHeight="22px" style="width:200px"&gt; &lt;a4j:ajax event="change" render="resultTable chart" execute="@this" listener="#{formBean.dateSelected}"/&gt; &lt;/rich:calendar&gt; &lt;/div&gt; &lt;div class="grid_2"&gt; &lt;h:selectOneMenu id="selectMenu" value="#{formBean.model.selected_id}" valueChangeListener="#{formBean.selected}" styleClass="comboBoxes"&gt; &lt;f:selectItems value="#{formBean.myModelValues}" /&gt; &lt;a4j:ajax execute="@this" event="valueChange" render="resultTable chart" ajaxSingle="true"/&gt; &lt;/h:selectOneMenu&gt; &lt;/div&gt; &lt;div id="list" class="container2"&gt; &lt;rich:dataTable id="resultTable" value="#{formBean.results}" var="query" rows="10" headerClass="columnclass" rowClasses="rowclass" styleClass="datatable" cellpadding="1" cellspacing="1" rules="rows" &gt; &lt;rich:column headerClass="columnclass" width="100" &gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="Values" style="align:center; text-align:center; " /&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{query.val}" /&gt; &lt;/rich:column&gt; &lt;rich:column headerClass="columnclass" width="100" &gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="Models" style="align:center; text-align:center; " /&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{query.model}" /&gt; &lt;/rich:column&gt; &lt;f:facet name="footer"&gt; &lt;rich:dataScroller page="#{formBean.page}" style="margin-left: 15%; margin-right: 15%; width: 70%;"&gt; &lt;f:facet name="first"&gt; &lt;h:outputText value="First" /&gt; &lt;/f:facet&gt; &lt;f:facet name="last"&gt; &lt;h:outputText value="Last" /&gt; &lt;/f:facet&gt; &lt;/rich:dataScroller&gt; &lt;/f:facet&gt; &lt;/rich:dataTable&gt; &lt;/div&gt; &lt;div id="graph" class="container2"&gt; &lt;a4j:mediaOutput id="chart" element="img" cacheable="false" session="true" createContent="#{mediaPainter.drawChartImage}" value = "#{sdh:storeData(formBean.chartData)}" mimeType="image/jpeg" /&gt; &lt;/div&gt; &lt;/h:form&gt; &lt;/h:body&gt; &lt;/html&gt; </code></pre> <p>here is a list of .jar files deployed with the webapp:</p> <p>cssparser-0.9.5.jar<br> mysql-connector-java-5.1.18.jar ehcache-1.6.0.jar<br> richfaces-components-api-4.1.0.Final.jar guava-r08.jar<br> richfaces-components-ui-4.1.0.Final.jar javax.faces-2.1.3.jar<br> richfaces-core-api-4.1.0.Final.jar jcommon-1.0.16.jar<br> richfaces-core-impl-4.1.0.Final.jar jfreechart-1.0.13.jar<br> sac-1.3.jar jstl-api-1.2.jar</p> <p>Here is the pom.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;org.models.presentation.&lt;/groupId&gt; &lt;artifactId&gt;graph_presentation&lt;/artifactId&gt; &lt;name&gt;graph_presentation&lt;/name&gt; &lt;version&gt;Final&lt;/version&gt; &lt;packaging&gt;war&lt;/packaging&gt; &lt;url&gt;http://jboss.org/richfaces&lt;/url&gt; &lt;repositories&gt; &lt;!-- You should seriously consider using a repository manager or declare repositories in your settings.xml. See http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/ --&gt; &lt;repository&gt; &lt;id&gt;jboss-public-repository-group&lt;/id&gt; &lt;name&gt;JBoss Public Maven Repository Group&lt;/name&gt; &lt;url&gt;https://repository.jboss.org/nexus/content/groups/public-jboss/&lt;/url&gt; &lt;layout&gt;default&lt;/layout&gt; &lt;releases&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;updatePolicy&gt;never&lt;/updatePolicy&gt; &lt;/releases&gt; &lt;snapshots&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;updatePolicy&gt;never&lt;/updatePolicy&gt; &lt;/snapshots&gt; &lt;/repository&gt; &lt;/repositories&gt; &lt;pluginRepositories&gt; &lt;pluginRepository&gt; &lt;id&gt;jboss-public-repository-group&lt;/id&gt; &lt;name&gt;JBoss Public Maven Repository Group&lt;/name&gt; &lt;url&gt;https://repository.jboss.org/nexus/content/groups/public-jboss/&lt;/url&gt; &lt;layout&gt;default&lt;/layout&gt; &lt;releases&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;updatePolicy&gt;never&lt;/updatePolicy&gt; &lt;/releases&gt; &lt;snapshots&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;updatePolicy&gt;never&lt;/updatePolicy&gt; &lt;/snapshots&gt; &lt;/pluginRepository&gt; &lt;/pluginRepositories&gt; &lt;properties&gt; &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt; &lt;maven.compiler.source&gt;1.6&lt;/maven.compiler.source&gt; &lt;maven.compiler.target&gt;1.6&lt;/maven.compiler.target&gt; &lt;!-- Setting this property using archetype-metadata.xml requiredPorperty so that generated project uses correct version of richfaces. --&gt; &lt;org.richfaces.bom.version&gt;4.1.0.Final&lt;/org.richfaces.bom.version&gt; &lt;/properties&gt; &lt;build&gt; &lt;finalName&gt;individuel_broadcast3&lt;/finalName&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt; &lt;version&gt;2.3.2&lt;/version&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt; &lt;version&gt;2.1.1&lt;/version&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;dependencyManagement&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.richfaces&lt;/groupId&gt; &lt;artifactId&gt;richfaces-bom&lt;/artifactId&gt; &lt;version&gt;${org.richfaces.bom.version}&lt;/version&gt; &lt;scope&gt;import&lt;/scope&gt; &lt;type&gt;pom&lt;/type&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/dependencyManagement&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.richfaces.ui&lt;/groupId&gt; &lt;artifactId&gt;richfaces-components-ui&lt;/artifactId&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.richfaces.core&lt;/groupId&gt; &lt;artifactId&gt;richfaces-core-impl&lt;/artifactId&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;javax.faces&lt;/groupId&gt; &lt;artifactId&gt;javax.faces-api&lt;/artifactId&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.glassfish&lt;/groupId&gt; &lt;artifactId&gt;javax.faces&lt;/artifactId&gt; &lt;scope&gt;compile&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;javax.servlet&lt;/groupId&gt; &lt;artifactId&gt;servlet-api&lt;/artifactId&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt; &lt;artifactId&gt;jsp-api&lt;/artifactId&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;javax.el&lt;/groupId&gt; &lt;artifactId&gt;el-api&lt;/artifactId&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;javax.servlet.jsp.jstl&lt;/groupId&gt; &lt;artifactId&gt;jstl-api&lt;/artifactId&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;net.sf.ehcache&lt;/groupId&gt; &lt;artifactId&gt;ehcache&lt;/artifactId&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;jfree&lt;/groupId&gt; &lt;artifactId&gt;jfreechart&lt;/artifactId&gt; &lt;version&gt;1.0.13&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;mysql&lt;/groupId&gt; &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt; &lt;version&gt;5.1.18&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;profiles&gt; &lt;profile&gt; &lt;id&gt;jee6&lt;/id&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;webappDirectory&gt;${project.build.directory}/${project.build.finalName}-jee6&lt;/webappDirectory&gt; &lt;classifier&gt;jee6&lt;/classifier&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;javax.faces&lt;/groupId&gt; &lt;artifactId&gt;javax.faces-api&lt;/artifactId&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.glassfish&lt;/groupId&gt; &lt;artifactId&gt;javax.faces&lt;/artifactId&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;javax.transaction&lt;/groupId&gt; &lt;artifactId&gt;jta&lt;/artifactId&gt; &lt;version&gt;1.1&lt;/version&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/profile&gt; &lt;profile&gt; &lt;id&gt;release&lt;/id&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;jee6&lt;/id&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;war&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;webappDirectory&gt;${project.build.directory}/${project.build.finalName}-jee6&lt;/webappDirectory&gt; &lt;classifier&gt;jee6&lt;/classifier&gt; &lt;packagingExcludes&gt;WEB-INF/lib/javax.faces*&lt;/packagingExcludes&gt; &lt;warSourceExcludes&gt;WEB-INF/lib/javax.faces*&lt;/warSourceExcludes&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;/profile&gt; &lt;/profiles&gt; &lt;/project&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload