I am trying to integrate Primefaces 5.2 to a JSF application which has version of 2.0.11-02. I am using IBM WebSphere 8.5.5 as application server. I am trying to use p:calendar in my page but it does not show up.
When I checked from Google Chrome Dev Tools, I noticed that the corresponding input field has no "click" event listener attached to it. In Primefaces Showcase the input fields has "click" event listener so when you click, calendar shows up.
I am also having the same trouble with sorting of datatable. The column has no "click" event listener, so it does not send any request when the header of a sortable column is clicked.
Please help me with that problem.
P.S: The application I am working on was a JSF 1.2 application and were using JWL libraries of IBM. Since I am upgrading the application to JSF 2, I am not able to use that library anymore. That's way I am trying to integrate Primefaces. primefaces-5.2.jar is placed under /WEB-INF/lib and I also still have jsf-ibm.jar, odc-jsf.jar in that directory.
try to create a lib folder out of the meta-inf and PrimeFaces put the library, or you could also try creating a page with the component PrimeFaces calendar to see if it works and put in
<html xmlns:p="http://primefaces.org/ui"</html>
Are you sure that you save your XHTML file with proper extension? If you have deafult settings it would be *.jsp as far as I remember
Related
How to make images slider (carousel) in Java Spring MVC.
I have admin panel which upload the images to local drive.
I would like to display images from local drive to JSP page in carousel.
Please guide.
Also I tried one example from the link https://blog.e-zest.com/dynamic-carousel-built-using-javascript/ but I am getting javascript error.
Thanks,
Bhavin
First you need to be able to serve your files to web browser. You can serve files from local drive using tomcat or web server (nginx, Apache httpd etc) built-in features without writing Java code or write a Spring controller to read files form drive and serve them if you need custom logic.
Then you could use one of javascript carousel plugins like Slick or another - there is a great choice of those.
Add needed scripts and css to your page and follow selected plugin instructions to create needed HTML with your JSP page.
I am a beginner in Java Web Applications and I read some information here on how to start use primefaces and as a result I added PrimeFaces components to my page as xmlns:p="http://primefaces.org/ui" and also added the primefaces-5.0.jar to my classpath:
MyProject->Java_Resources->Libraries->primefaces-5.0.jar
I read that I had to add primefaces-5.0.jar to WEB-INF->lib->primefaces-5.0.jar and I did it, but I couldn't work with primefaces. I ran my project and neither of primefaces didn't show and also I didn't see any warnings and errors. Do you know any solutions to my problem?
You need to add Jsf component libraries which called jsf-imp.jar and jsf-api.jar and should make configuration on web.xml. You should watch the Jsf+Primefaces Tutorial for beginners.Here is good understandable tutorial for you. http://www.youtube.com/watch?v=F4NawR70uT0
I need this for the import functionality of the web-based app im creating. I need to get the path of a text file the user wants to be imported in order to egt the data inside the text file and saves it in a database.
There is no such component in standard JSF. However, there are several component libraries that offer file selection:
PrimeFaces <p:fileUpload>
RichFaces <rich:fileUpload>
IceFaces <ice:inputFile>
Tomahawk <t:inputFileUpload>
etc. - basically every JSF component framework has such a component
You could check this out - http://livedemo.exadel.com/richfaces-demo/richfaces/fileUpload.jsf, and build yours accordingly.
I need to display some tabular data in a JSF page. I need some kind of grid component, but it is a must for it to have a pager and also to be able to sort the displayed data(example: by date created, alphabetically or simmilar...) Most probably i will start to create a custom component that fits all my needs, but i was wondering is is there any tag in JSF 2.0 or in some other library that already includes all this features. I would prefer not to use an external library like richfaces or similar just clean JSF 2.0. But if there is any good gadget out there i might give it a try.
Have a look at the p:dataTable component from Primefaces. It has sorting, filtering, pagination, row selection and a lot more features.
Getting started with Primefaces is quite simple. Download the jar, put it in your classpath and add the following namespace definition to your facelet's html tag:
xmlns:p="http://primefaces.prime.com.tr/ui"
The problem:
When the user clicks on www.example.com/myapp/myview?id=1 I need to display the item with id=1 which is in the database. To do that I need to execute bean methods. (Ideally the user would have to login first if not in cookies and then redirect but that's another problem).
I'm using Richfaces 3.3.3 with JSF 2.0 (So VDL is deactivated and Facelets have to be used yet) so it's incompatible with PrettyFaces (they use the built in Facelets into JSF2).
RestFaces does not have JSF2.0 Version and seems outdated (last version is from June 2008).
Any idea how to solve it?
Thanks in advance.
Check RestEasy it is used in
JbossSeam which also integrates JSF with Rich- and Icefaces,Rest and much more.
have a look at http://ocpsoft.com/prettyfaces/ if that helps ... or else try some magic with preRenderView event in jsf2