Primefaces Style Doens't work correctly - jsf

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 -.-

Related

Selectively disable JSF resource dependencies

If I use both bootsfaces and butterfaces in a single page, both libraries import their bundled jquery and bootstrap stylesheet as belows:
<link type="text/css" rel="stylesheet" href="/javax.faces.resource/bootstrap.min.css.xhtml?ln=butterfaces-configurable">
<link type="text/css" rel="stylesheet" href="/javax.faces.resource/css/bootstrap.min.css.xhtml?ln=bsf">
<script type="text/javascript" src="javax.faces.resource/jquery.min.js.xhtml?ln=butterfaces-configurable"></script>
<script type="text/javascript" src="javax.faces.resource/jquery.min.js.xhtml?ln=bsf"></script>
If both libraries use the same version , it waste bandwidth to import duplicate things. If both libraries use different versions , it is possible to have conflict. What is the best approach to deal with this? Can I selectively disable one component libraries to import certain stylesheets or scripts ?
you can use following web.xml parameter to disable providing jQuery in #ButterFaces.
<context-param>
<param-name>de.larmic.butterfaces.provideJQuery</param-name>
<param-value>false</param-value>
</context-param>
you can likewise disable bootstrap if you have your own version
<context-param>
<param-name>de.larmic.butterfaces.provideBootstrap</param-name>
<param-value>false</param-value>
</context-param>
Update January 22, 2016: In the meantime, we (the BootsFaces team) went into some lengths to add fine-grained control over the resource loading. See http://www.bootsfaces.net/layout/resourcemanagement.jsf for details. Cutting a long story short, BootsFaces doesn't load jQuery, jQueryUI or Bootstrap if it detects these resources are already there. Plus, you can deactivate resource loading by an web.xml context parameters.
Outdated original answer:
Currently, the only solution is to use OmniFaces, like BalusC said. We could offer to improve BootsFaces so that it adds jQuery.min.js and bootstrap.min.css only if these libraries aren't provided by the JSF page. In this case, ButterFaces would provide jQuery and BootsFaces. Of course, you'd be responsible to make sure that the jQuery version provided is compatible to BootsFaces.

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.

myFaces Trinidad example not displaying

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?

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