Help needed to create a Search page using JSF, EJB, JPA & Primefaces with Pagination - jsf

I am trying to make a search page using JSF, EJB, JPA & Primefaces with Pagination from an Oracle database table.
The page has two regions (1) region for entering search parameters
(2) region with a datatable showing the search result. This datatable supports pagination.
I have used standard code generated using Netbeans IDE, but dont know how to pass the parameters while clicking the search button and show the results based on the search in the datatable.
Please help me with sample code.
Thanks in advance.

For the input, just use a normal form like as you've created in a hello world tutorial. For presentation and pagination of the results, use PrimeFaces LazyDataModel. See also their showcase example.

Related

Is it possible to use PrimeFaces dataTable in IceFaces environment?

I have an application using IceFaces 3.3 (non-EE version) for user interface. I would like to replace some of the pages to PrimeFaces.
As a trivial case, I created a new page with only HTML and PrimeFaces tags on it. There is a sortable and filterable lazy dataTable on the page and nothing else. The table first loads fine but when I initiate a sorting or filtering operation, the entire table disappears.
When I inspect the page, I see IcePush is operating and the IceFaces Bridge is loaded. In case of the above mentioned partial page reload, in the response XML, the dataTable appears within delete tags however, it should be present within update tags instead.
It seems that adding org.icefaces.subtreeDiff=false to web.xml solves the problem.

Displaying a list like a p:selectOneMenu in a page wise manner

I'm trying to manage a <p:selectOneMenu> drop-down to show a list of 12000 records; I'm searching for a smart component within "paginate" my results and dynamic load on scrolling.
Can someone help me?
I'm using Primefaces 3.5
Thanks
Davide

Generic CRUD using JSF and PRimeFaces

I was looking for some general guidelines for creating a generic CRUD page using JSF (2.1) and PrimeFaces (5.0)(specifically using PF's <p:dataTable> component). Some of my requirements are as follows:
Dynamic number of columns (based on the #of columns of a selected Database Table)
Inline editing
Popup (dialog) edit
I have tried using <p:columns> component to show the dunamic #of columns, however, it seems I cannot use the inline editing feature <p:rowEditor> when I use <p:columns>
Any help in terms of suggestions/recommendations is highly appreciated. My goal is not to create seperate pages for each table but to use the same page (component) for multiple DB tables.

jsf popupwindow with a datatable

I have a form which one of it's fields is a code and description, also a button for opening a popup window that contains a list of all of the available codes.
when the user double clickes a row from that table i want to set these values to the code and description. - how can this be done?
Another question, I want to create this popup and table to be initialized dynamically - by that i mean that if i have a few forms in my application, when ever i have a field which has a description i want to be able to open this popup and to see the available list for that field. (every field can be from a diffrent table). is it possible to create something like that? if so, how?
Any help will be appritiated,
Thank's In Advance.
Yes, it is possible. Even more, many component libraries have ready to use popup/dialog components, such as RichFaces with <rich:popupPanel> and PrimeFaces with <p:dialog>.
If you do not want to use a component library for some reason, you would need to create a custom component for this which generates basically an absolutely positioned HTML <div> element with a CSS overlay which get shown/hidden by JS on a particular click/action. The HTML/CSS/JS part should be relatively simple if you are familiar with those languages. The JSF part is somewhat hard if you have never created a custom component before, but it should be possible with a composite component as well, so you could also just create one with pure XHTML. The updating/refreshing can just take place by the usual <f:ajax> means.

Make editable rows in Datatable

I have list of rows displayed on the screen. These rows are iterated using the JSF datatable component. Now my requirement is to edit any particular row which user clicked.
Is there any way to make the fields editable while user clicking the row. Then user will fill the details and save it.
Any suggestions would be appreciated.
Creating editable data tables is very easy with jsf. Here is a good tutorial on this. But "making it editable when user clicks on it" is not supported out of the box. And this is where JSF shines, you just need to find for a JSF component (open source or commercial) compatible with your JSF (1.x or 2.x) version and start using it.
My first suggestion for you is to check and see if PrimeFaces provides this kind of component. Here is the component you are looking for.

Resources