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.
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 new to Primefaces and JSF. I need to create a screen that allows Operators to view all files in a certain directory for that days date. This will need to be displayed on the datatable. I am not sure how to do it. I am not using a database at all, only directories. Thank you
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
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"
Im new to Liferay . I have downloaded the Liferay Tomcat bundle v5.2.3 Community Edition from the Liferay website. I am able to run it successfully.
I am now trying to create an intranet portal for our company using Liferay . I created an Organization in Liferay and added some pages and child pages to it.
How to add content to a page ?. I mean, i would like to add some text and images etc to the home page and other pages on the portal. I tried the Web Content Display portlet, but it always appears minimized and i have to maximise it by clicking on the maximize button. And also the option to minimize/maximize the portlet is available only when im logged in.
Is there any other way to add HTML content to a page, to make it look like a normal html page which anybody can view when they visit the portal ?
Thank You.
Web Content Display is indeed the easiest choice. You probably just made a mistake when using it.
Add the web content display portet
Click on "add web content" icon at the bottom-left of the portlet
You get a rich text editor, but you can also toggle to HTML view
When you're done click on "Save and approve".
Liferay CMS is built on the concept of template, structure and article.
structure: the element to be rendered, e.g. one text area + one image
template: the rendering of the structure, e.g. image in top-left + text around the image
article: the actual data that corresponds to a structure
But you should be able to edit your first Web Content Display without having an structure nor template. But I suggest you to have a look at them once your are used to the portal.
Once you have added the web content portlet and then added content, you need to configure the layout template you want. Choose the one column layout to let the portlet take up the whole screen.
I think you are asking how to create a new page of type web content.
note the content_id of your web content
make sure your web content is approved, published, and viewable (permissions)
create your page, entering your content_id into the Web Content ID field
I think when you do it this way, you forsake some of the portlet functionality that Liferay brings you.