myFaces Trinidad example not displaying - jsf

Hi I have followed the setup guide at:
http://myfaces.apache.org/trinidad/installation.html
When I include the following code in my faces-config.xml file I get an error when I hit a page:
<application>
<default-render-kit-id>org.apache.myfaces.trinidad.core</default-render-kit-id>
</application>
Start of Error:
java.lang.IllegalStateException: No RenderingContext
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeBegin(CoreRenderer.java:390)
at org.apache.myfaces.trinidadinternal.renderkit.htmlBasic.HtmlFormRenderer.encodeBegin(HtmlFormRenderer.java:56)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:813)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:928)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
When I remove that piece of code from my faces-config.xml file I can navigate my site as normal, but when I hit a page that has some sample Trinidad code nothing is displayed...just an empty page.
Any ideas on what I'm doing wrong?
I removed the following from my web.xml and its working now, any ideas? Confused :(
<context-param>
<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
<param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>
Thanks

I've actually discovered an excellent control for Richfaces that will provide the same functionailty. I'm going to go with this instead.
http://livedemo.exadel.com/richfaces-demo/richfaces/extendedDataTable.jsf?c=extendedDataTable&tab=usage
As BalsusC suggested, mixing different ajaxical component libraries might not be such a good idea.
Additionally, I have found the documentation and examples for Trinidad to be quite poor; Particularly in comparasion to Richfaces.
Would I be correct in thinking Trinidad is slowly dying?

Related

Applying Theme in Primefaces 5.1 via primefaces.THEME doesn't work

I am trying to get the downloaded Dark-Hive Themeroller theme for a PrimeFaces project going but can't figure out why it won't show...Looking into the html source code I always see Aristo theme, which I believe is the default PrimeFaces theme. I followed multiple forum suggestions but have to post this one into the community - maybe someone can give me a hint.
Project structure:
/webapp/WEB-INF/lib/dark-hive.jar -> downloaded from themeroller.org
and converted with themeroller.osnode.com/themeroller into a PF
theme
/webapp/WEB-INF/templates/layout.xhtml -> my master template, which contains xmlns:h="http://java.sun.com/jsf/html" namespace attribute as well as tag
/webapp/WEB-INF/resources
/webapp/WEB-INF/web.xml
/webapp/WEB-INF/faces-config.xml
...
I don't output any CSS simply because according to the docs it's not needed for PF themes to work.
Parts of web.xml:
<context-param>
<param-name>javax.faces.WEBAPP_RESOURCES_DIRECTORY</param-name>
<param-value>/WEB-INF/resources</param-value>
</context-param>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>dark-hive</param-value>
</context-param>
Please note that I moved the resources folder into WEB-INF/.
Parts of pom.xml:
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>dark-hive</artifactId>
<version>1.0.8</version>
</dependency>
Because of Maven dependency and manual download/drop into /WEB-INF/lib folder I now have 2 dark-hive.jar in my war file:
/WEB-INF/lib/dark-hive-1.0.8.jar
/WEB-INF/lib/dark-hive.jar
Both have the same internal structure.
I am using WildFly 8.1.0.Final with upgraded JSF Mojarra 2.2.8, PrimeFaces 5.1, OmniFaces 1.8.1
Any ideas?
The answer lies within the use of OmniFaces showcase HeadRenderer.
In my faces-config.xml I was using:
<render-kit>
<renderer>
<component-family>javax.faces.Output</component-family>
<renderer-type>javax.faces.Head</renderer-type>
<renderer-class>org.omnifaces.showcase.HeadRenderer</renderer-class>
</renderer>
</render-kit>
which used the primefaces-aristo theme.
Solution was to write my own HeadRenderer according to:
Custom HeadRenderer

How to prevent loading of Richfaces 4 component css files

I'm upgrading from Richfaces 3.3 to 4.
I have a number of custom css files and skins.
Richfaces 4 seems to have added a whole load of new classes to various components i.e. rf-tab, rf-tab-cnt, etc.
These components have styles associated with them (They appear to be loaded in ecss file with names like panel.ecss, datascroller.ecss, etc)
They have really messed up my current UI layout :(
Is there any way to disable the loading of all these component stylessheets?
I tried applying the following but it does not work:
<context-param>
<param-name>org.richfaces.LoadStyleStrategy</param-name>
<param-value>NONE</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.COMPRESS_STYLE</param-name>
<param-value>false</param-value>
</context-param>
Thanks
Use 'plain' skin. This way most CSS classes will be rendered but not defined...

AC_FL_Runcontent is not defined , Exadel Fiji

I am using Exadel-Fiji 1.0, Richfaces 3.3.3, Jboss 4.3 -EAP, Seam 2.1.0, JSF-1.2_09
When I try to render a exadel fiji line chart , the page just throws up a blank screen and
the firefox error console says
AC_FL_Runcontent is not defined
I found the solution.
I had the following code in my web.xml. I had to comment it out to get it working
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>NONE</param-value>
</context-param>
This script error is because one of the fiji related js file is missing in your jsf page. Please add the following script in your xhtml/jsf page to resolve this issue:
<script type="text/javascript" src="/[your-application-context-name]/a4j/g/3_3_1.CR1com/exadel/fiji/renderkit/html/AC_OETags.js.jsf" />
Before testing this in your application, please check that you are able to view Javascript with your browser using the following URL:
http://[url]:8080/[your-application-context-name]/a4j/g/3_3_1.CR1com/exadel/fiji/renderkit/html/AC_OETags.js.jsf
or
http://[url]:8080/your-application-context-name/a4j/g/3_3_1.CR1com/exadel/fiji/renderkit/html/AC_OETags.js
If you are able to see the script content in your browser, your problem has been resolved, and there will be no need to comment the web.xml changes.

Primefaces Style Doens't work correctly

I started a JSF project and included primefaces. But I have problems with the style. It doesn't look that nice than in the official showcase. But I have no idea why.
That's what I did so far:
I downloaded a style and extracted it into my project.
I added <link type="text/css" rel="stylesheet" href="#{request.contextPath}/resources/flick/skin.css" /> to my facelets template
I extended my web.xml with the following:
<context-param>
<param-name>primefaces.skin</param-name>
<param-value>none</param-value>
</context-param>
Unfortunately it loks like that:
fyi: That's a prime panel and a prime button :-/
can you pls help me :-)
cheers
Update:
Whatsoever I change in context-param. it doesn't work!
Do you need more information to help me solve that problem?
Thank you for help..
That's becuase you used none skin.
Look in Prime different skins to choose the right skin.
For example, if you would like Eggplant add:
<context-param>
<param-name>primefaces.skin</param-name>
<param-value>Eggplant</param-value>
</context-param>
I switched from myfaces to mojarra and now it works -.-

JSF 1.1 and tomahawk 1.1.1 inputCalendar, is myfaces-*.jar needed?

I should use JSF 1.1 Mojarra implemetnation in job project.
But I need a popUp calendar widget. I've tried many different frameworks and stopped on tomahawk. I've setupped filter for tomahawk javasripts in web.xml but still have problems.
Should I necessary replace jsf-impl.jar and jsf-api.jar with myfaces-impl.jar and myfaces-api.jar ?
Or can I work with some versions of tomahawk calendar without faces.jar ?
Maybe someone can advice some popup calendar widget for JSF 1.1 from other frameworks that can be easy integrated?
Should I necessary replace jsf-impl.jar and jsf-api.jar with myfaces-impl.jar and myfaces-api.jar ?
No, that's not needed. Tomahawk is just a component library which is supposed to be JSF implementation independent. That it is created by the MyFaces guys is pure coincidence. I've used Tomahawk on Mojarra for ages and it works fine.
You should be more clear about those "problems" if you want more assistance. Ask a new question wherein you post the problem in depth detail (JSF/Tomahawk/Servletcontainer impl/version, steps done, unexpected results, any warnings/errors/exceptions, etc).
If you just need a date picker, you could use the pure javascript library, eg: http://www.nsftools.com/tips/DatePickerTest.htm
Seams that this combination works with JSF 1.1 Mojarra implementations:
commons-fileupload-1.2.2.jar
tomahawk-1.1.9.jar
And changes in web.xml:
<filter>
<filter-name>extensionsFilter</filter-name>
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
</filter>
<!--
extension mapping for adding <script/>, <link/>, and other resource
tags to JSF-pages
-->
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<!--
extension mapping for serving page-independent resources (javascript,
stylesheets, images, etc.)
-->
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>

Resources