Is p:media incompatible with view scope? - jsf

I am using jsf 2.1 in a web project with primefaces 3.5 and glassfish 3.2.
When I use p:media tag along with a view scoped managed bean, an error occurs indicating an xml parsing error.

I am not pretty shure if this leadds to the same problem like with using Richfaces and its a4j:mediaOutput. There you cannot use it in ViewScope but here is a link to a workaround. I hope it fits to your problem.

Related

Can Bootsfaces be used with Richfaces?

I have a web application with the following:
JSF 2.2.6
Java 1.7
Tomcat 8
Richfaces 4.5.7
Omnifaces 2.2
I would like to enhance the look and feel of the web app to use Bootsfaces. I have added Bootsfaces jar to my project (via .ivy) and rebuilt.
Before even updating the first web page to use Bootsfaces in the project I wanted to see if there were any conflicts after adding the Bootsfaces jar. It seems there is. I am getting the following errors shown in Firebug:
ReferenceError: jsf is not defined
TypeError: RichFaces.ui is undefined
Does anyone know whether Bootsfaces works with Richfaces and if so could they kindly provide a link with migration steps to follow?
Currently, we, the BootsFaces team, do not support RichFaces. We strive for compatibility with PrimeFaces, OmniFaces, AngularFaces and - if possible - ButterFaces. Neither RichFaces nor ICEFaces are on our list.
However, if someone were to join our team in order to support RichFaces, they'd certainly be welcome!

Custom component in IceFaces?

Who knows how to create a custom component in an old version of IceFaces 1.6.2? I didn't find anything in the web about that, just some materials about custom components for JSF 1.1. Please, show me simple "Hello World" custom component with file name and directory declaration.
Please look at http://www.exadel.com/tutorial/jsf/jsftutorial-customcomponents.html
JSF Tutorial. You do not need special example for IceFaces 1.6.2, you can use IceFaces component within you own jsf component.

How to upload file in RichFaces 4?

I need to make a file upload function in JSF 2 so I was searching about it and found it is possible to do with Tomahawk, which I think is not very stable with JSF 2.
I'm using RichFaces, so I look for it and found this which I think more simple, but I'm using richfaces 4.
So I wonder if there's a way to do this with richfaces 4 or do this with JSF 2 only.
Any idea, suggestion ?
You're looking at RichFaces 3.3.x demo site. You need to look at RichFaces 4.x demo site. The <rich:fileUpload> demo page contains a concrete example with source code.
To do it with pure JSF2, you'd need to create a custom component and parse the multipart/form-data requests yourself. There's a blog about this with complete and concrete examples: Uploading files with JSF 2.0 and Servlet 3.0.
Using Tomahawk is only more easy. I'm not sure why you think that it's not very stable.

Using reCaptcha

I want to use reCaptcha on my project with JSF. Corresponding primefaces component doesn't want to work properly inside wizard component. I decided to try to use the code from example for JSP http://code.google.com/intl/en-en/apis/recaptcha/docs/java.html I can not understand how best to remake it to JSF. The problem is in java code injection into JSP and result validation via FacesValidator.
Can someone have any ideas?
Take a look at tomahawk t:captcha on MyFaces SVN. The code only use the standard JSF API (it was updated to use JSF 2.0 ResourceHandler API), so it can help you to build your own using recaptcha.

How get Tomahawk functionality with JSF 2.0 (Glassfish V3)

I've started to upgrade an existing application written with JSF 1.1 and MyFaces Tomahawk 1.1 to JSF 2.0 to get facelets etc.
I've now run into the snag that apparently Tomahawk is not JSF 2.0 compatible as it expects the stand-alone version of Facelets instead of the built-in to JSF 2.0 with the following error:
org.apache.catalina.LifecycleException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! com.sun.facelets.tag.jsf.ComponentHandler
(it appears to be placed in javax.faces.view.facelets now).
I have looked around and there doesn't seem to be a JSF 2.0 facelet compatible version of Tomahawk. I only believe I need t:updateActionListener (inside t:dataTable) and the rowSpan facility of t:panelGroup. Is all this functionality available in JSF 2.0 directly, or must I locate a new library giving this?
Any suggestions?
The t:updateActionListener is covered by the JSF 1.2 f:setPropertyActionListener.
For rowspans (and colspans) there's unfortunately still no functionality in the standard JSF implementation. However, since JSF 1.2 you're allowed to write down "plain vanilla" HTML in the view without any pains (no hassle with f:verbatim and so on). You can make use of the Facelets' ui:repeat to iterate "plain" over a collection. Since JSF 2.0 you can even create composite components (templatebased components). This must enable you to make use of the HTML rowspans/colspans.

Resources