-
1. Re: Richfaces Themes not working if code generated dynamically from java
ranveer.singh Oct 10, 2011 11:50 AM (in response to ranveer.singh)Forgot to add, I am using richfaces4 and JSF2.0 and web.xml is as follows..
<?xml version="1.0" encoding="UTF-8"?>
<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"
version="2.5">
<display-name>ims1</display-name>
<context-param>
<param-name>org.richfaces.skin</param-name>
<param-value>classic</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.enableControlSkinning</param-name>
<param-value>false</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<mime-mapping>
<extension>xcss</extension>
<mime-type>text/css</mime-type>
</mime-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
-
2. Re: Richfaces Themes not working if code generated dynamically from java
ranveer.singh Oct 11, 2011 1:19 PM (in response to ranveer.singh)I am adding the navigation xml, i am using. This code is working fine.
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
>
<rich:panelMenu>
<rich:panelMenuGroup label="Home">
<rich:panelMenuItem/>
</rich:panelMenuGroup>
<rich:panelMenuGroup label="Academics">
<rich:panelMenuItem label="Semester"/>
<rich:panelMenuItem label="Section/Class"/>
<rich:panelMenuItem label="Batch Detail"/>
<rich:panelMenuItem label="Subject Detail"/>
<rich:panelMenuItem label="Syllabus/Weightage"/>
<rich:panelMenuItem label="Curriculum"/>
</rich:panelMenuGroup>
</rich:panelMenu>
</ui:composition>
########################This code is not working #######################
I am generating the panelMenu through the java code. When i am trying to generate through javacode firebug is throwing error Richfaces not found
and i found that taglibs are getting ignored. Please help i am completely stuck with this. I have used richfaces 3.3 in same fashion and there were no problems.
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
>
<rich:panelMenu binding="#{componentNavigator.panelMenu}" />
</ui:composition>
-
3. Re: Richfaces Themes not working if code generated dynamically from java
ranveer.singh Oct 14, 2011 3:01 AM (in response to ranveer.singh)Please follow the given thread.
Before that just wanted to brief the solution. Problem was the way i was using creating the UIPanel. I was using
UIPanel panel = new UIPanel();
but it should be used like given below,
FacesContext ctx = FacesContext.getCurrentInstance();
UIPanelMenu panelMenu = (UIPanelMenu)ctx.
getApplication().createComponent(ctx,UIPanelMenu.COMPONENT_TYPE,"org.richfaces.PanelMenuRenderer");
This works fine in Request Scope but still has some issue with Session Scope. Please go to the below thread for discussion, otherwise it will be duplicate discussion.