FAQ Database Discussion Community


Avoid datatable update in case of error during record edition (JSF + Primefaces)

jsf,jsf-2,primefaces,datatable
I have a web-app in JSF 2.1 + Primefaces 5.1. I have a datatable with selectable rows. When I select a row and press the Edit button, a dialog opens to allow the user to edit the values of that record. When the user presses the dialog's Save button, a...

primefaces push not working in Safari using AWS Tomcat7

tomcat,primefaces,safari,websocket,push
I am using PrimeFaces 5.1, JSF 2.1 and tomcat 7 and my application is in AWS. atmosphere version 2.2.2. I am not able to use push functionality in Safari 5.1.7. We have configured the AWS to enable push based on Primeface push with AWS , Websocket with Tomcat 7 on...

p:orderList converter getAsObject() doesn't call Object.toString()

jsf,primefaces,converter
I've written a custom converter as follows: @FacesConverter(value = "orderListConverter") public class OrderListConverter implements Converter { @Override public Object getAsObject(FacesContext context, UIComponent component, String value) { Object ret = null; if (component instanceof OrderList) { Object list = ((OrderList) component).getValue(); ArrayList<ExampleEntity> al = (ArrayList<ExampleEntity>) list; for (Object o : al)...

How to resize button in primefaces?

primefaces,xhtml
In Primefaces ShowCase is an example how to use an effects. One of these I used for button - resize. <p:commandButton type="button" value="Show" style="width:200px" icon="ui-icon-image"> <p:effect type="size" event="mouseover"> <f:param name="to" value="{width:300}" /> </p:effect> </p:commandButton> Similar example is on this page "Size" It works, but after the button resize to 300px...

Component rendering problems with primefaces in eclipse for JSF [duplicate]

jsf,jsf-2,primefaces
This question already has an answer here: JSF returns blank/unparsed page with plain/raw XHTML/XML/EL source instead of rendered HTML output 1 answer I'm trying to work on primefaces. when i am trying to run a xhtml page individually in my eclipse IDE, All the primeface elements included in my...

Hide all primefaces blockui elements

jsf,jsf-2,primefaces,blockui
I have a lot of .xhtml views. Many of them have blockui elements, for example: <p:blockUI block="tab" widgetVar="subscriberSelectBlocker"> </p:blockUI> Sometimes there are more then 1 of them per view. To hide the blockUI above I have a method in the according bean SubscriberFilterBean.java: public void hideSubscriberSelectBlockUi() { RequestContext.getCurrentInstance().execute("subscriberSelectBlocker.hide()"); } Now...

/ UI Layout Initialization Error The center-pane element does not exist. The center-pane is a required element

jsf-2,primefaces
I am new to stackoverflow and also this my very first question to this forum so if i am doing something wrong when i am posting here please let me know. my question related to primefaces i tried with lot of solution but nothing work for me. i am using......

Select all items in Multiple SelectManyCheckBox with dynamic ids

jquery,jsf,primefaces
I want to select all check box in some groups of checkboxes using PrimeFaces component on top of JSF. My code is like this: <h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5"> <p:outputLabel value="Confere:" style="font-weight:bold!important" /> <p:selectManyCheckbox value="#{funcionarioBean.funcionario.permissaoConfere.stringArray}"> <f:selectItem itemLabel="Consulta" itemValue="C" /> <f:selectItem itemLabel="Edição" itemValue="E" /> <f:selectItem itemLabel="Deleção" itemValue="D"...

PrimeFaces Piechart: Tooltips are not displaying in my local environment

primefaces,charts,tooltip,pie-chart
I have recreated the example page shown in the primefaces showcase at: http://www.primefaces.org/showcase/ui/chart/pie.xhtml The pie chart successfully display and I am able to tweak the pie chart model for available setters and getters, but hovering over a piece of the pie does not display any tooltip at all. This is...

Embed JSF code in a xhtml

jsf,primefaces
I need to complete a xhtml page with some JSF code (with p:panel and p:datatables, etc.) from a managed bean, but I'm not sure that is possible. My attemps: 1º <h:outputText escape="true" value="#{controller.jsfString}"/> It's not be able to understand "p:" components, only simple html. 2º <ui:include src="#{controller.jsfString}"> It expects a...

ajax validation error message [duplicate]

ajax,jsf,jsf-2,primefaces
This question already has an answer here: Custom JSF validator message for a single input field 1 answer how to add my own message for the client side validation in JSF. <div class="ui-grid-row"> <div class="ui-grid-col-3" align="left"> <h:outputLabel for="cmpny" value="Company Name:" style="font-weight:bold" /> </div> <div class="ui-grid-col-2"> <p:inputText id="cmpny" value="#{userData.cmpny}"> <f:validateLength...

How to execute two methods with ajax listeners from selectOneMenu Primefaces

jsf,primefaces
I need to run two methods to populate data into two datatable with respective to selection made in selectOneMenu. But I could only run one method with ajax listener. I tried to nest both of the methods in one another but , as both of the methods involve database codes...

How to overwrite CSS style in Primefaces AutoComplete?

primefaces,xhtml
As far as I know the AutoComplete component generates a span element with an input inside. I want to link said input to a certain class in my stylesheet so it can be just like the second and third normal input fields here: Link to imgur, I can't embed images...

Primefaces Datatable Filtering is Case Sensitive

jsf,primefaces
After I search for a string, it lists in datatable and I would like to know if I filter my string value in primefaces datatable in case insensitive, I'm using Primefaces 5.0 Community edition. <p:dataTable id="users" var="user" value="#{ProcessBean.kList}" emptyMessage="#{msg['noRecordsFound']}" dynamic="true" paginator="true" rows="10" rowKey="#{user.ID}" rowStyleClass="#{(rowIndex mod 2) eq 0 ? 'highlight1'...

p:dataTable with paginator: how to use p:printer to print all rows without paginator

jsf,primefaces,printing,datatable,paginator
In a <p:dataTable> with paginator, I need to print all the pages. When I use <p:printer> and give the datatable as target, it only prints first page with pagination controls. How can I print all the rows of the table with <p:printer>?

p:dataTable doesn't render header after filtering and paging back

jsf,primefaces,datatable,filtering,tableheader
I need to keep filtered data when I navigate between pages. After entering data into a filter cell of a data table, it displays correct filtered rows. If last entered data in the filter cell doesn't match any data rows to display and when I navigate to another page and...

PrimeFaces CommandButton is not working in Dialog

primefaces,dialog,commandbutton
I need your help in solving the issue with the CommandButton in the dialog as I am calling a method called UpdatePrint() in the action and it is not called. The jsf page code is as follow: <h:form id="Requests"> . . . <p:commandButton update=":Requests:#{hr.dialogueName}" oncomplete="PF('#{hr.certificateDialogue}').show()" icon="ui-icon-search" title="View"> <f:setPropertyActionListener value="#{hr}" target="#{hrd.selectedRequest}"/>...

How to 'unrender' a p:inputText based on p:selectManyCheckbox selection

ajax,jsf,primefaces
I need your assistance in rendering inputText based on the selecttio of the selectManyCheckbox in the xhtml. The code is: <p:selectManyCheckbox id="basic" value="#{user1.selectedConsoles}"> <f:selectItem itemLabel="Xbox One SS" itemValue="XboxOne" /> <f:selectItem itemLabel="PS4 SS" itemValue="PS4" /> <f:selectItem itemLabel="Wii U SS" itemValue="WiiU" /> <p:ajax listener="#{user1.renderInput}" update="name"/> </p:selectManyCheckbox> <h:panelGroup id="name"> <p:inputText value=""...

p:dataTable not showing updated records from database on Dialog close

ajax,jsf,primefaces,datatable,dialog
I need your help in refreshing the dataTable component on closing the Dialog. I tried many ways to refresh the dataTable, but it is not retrieving the updated record, unless I have refreshed the full page by clicking on the "Go" button which is next to the URL in the...

Primefaces datatable and ViewScoped

primefaces,jsf-2.2,view-scope
I'm using primefaces 5.0 on wildfly 8.2.0 (mojarra 2.2.8). I tried to use a simple primefaces datatable with expansion but each time I expand a row, my backed bean @PostConstruct is triggered (which reloads the data which nullifies the use of @ViewScoped in the first place). I've seen other questions...

Error occurred while convert the dataTable to excel. [duplicate]

excel,jsf,primefaces,datatable
This question already has an answer here: java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/RichTextString at org.primefaces.component.export.ExporterFactory.getExporterForType 2 answers I got these error message while click the export button in the sever. I can't convert that table. I used primeface 5.0 and netbeans 8.0.2 version and GlassFish server 4.1 How can i solve this problem?...

Primefaces's dialog 'appendTo' property, what it useful for?

jsf-2,primefaces
Maybe it's a dumb question, but in Primefaces's <p:dialog> there's property which called appendTo which described in manual as: Appends the dialog to the element defined by the given search expression. I can't realize what it useful for? ...

Why does SpringBeanFacesELResolver cancel UIComponent binding?

jsf,primefaces,spring-security,uicomponents
I have a web app that uses Primefaces. I bind some facelet components to UIComponent type fields in my backing managed beans. Something like this: <p:panel id="loginPanel" rendered="false" binding="#{loginBean.loginPanel}" style="border: none"> And no additional annotations in bean just like this: @ManagedBean public class LoginBean { String name; String password; UIComponent...

Primefaces validation not working

jsf,jsf-2,primefaces
I am working on a form, where i am using primefaces. When i validate an inputtext, then ajax message is working for only for field and not for the others, please, check my code below. <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"...

Putting inside a causes “weird” display

jsf-2,primefaces,panelgrid
I want to create dynamic forms with ajax update on event. Therefore dynamic-id is important. However, binding the id attribute to a bean value causes Empty Id exception. I saw one of the stackoverflow questions that suggests use html. So I used span. The xhtml code is as follows: <?xml...

UploadedFile is null when uploading file with

jsf,file-upload,primefaces,nullpointerexception
I need to upload an image into the server. I'm using primefaces, here is my code: deposit.xhtml <h:form> <p:fileUpload mode="simple" allowTypes="/(\.|\/)(gif|jpe?g|png)$/" value="#{imageHandler.uploadedPicture}" /> <p:commandButton action="#{imageHandler.savefile(imageHandler.uploadedPicture)}" value="Déposer" ajax="false" /> </h:form> ImageHandler: @ManagedBean (name = "imageHandler") @RequestScoped public class ImageHandler { private UploadedFile uploadedPicture; // +getter+setter public void savefile(UploadedFile...

How to print javascript alert message in p:message of primefaces

javascript,jsf,primefaces
Javascript of my code function checkPasswordMatch() { var password = document.getElementById("password").value; var confirmPassword = document.getElementById("confirmPassword").value; if (password != confirmPassword){ alert("Passwords do not match!"); }else{ alert("Passwords match."); } } primefaces jsf code <h:form> <h:panelGrid columns="2" id="matchGrid" cellpadding="5"> <h:outputLabel for="pwd1" value="Password 1: *" /> <p:password id="pwd1" value="password" label="Password" required="true" /> <p:message...

Tel Number visualization patern - space after each 2 number

validation,jsf-2,primefaces,data-visualization
I have an Editabe Datatable. After user inserts the tel number in tel column which is an input textbox, and the ok is clicked, I need to visualize it as the following: INPUT 390239266655 OUTPUT +39 02 39 26 66 55 so i need to put a space after each...

Refresh selection model of p:datatable on row deselection

jsf,primefaces,datatable,selection
I have a problem with the selection model of a Primefaces 5.0 datatable. This selection model does not process deselection properly: Selection of rows adds these roles as expected to the list of selected rows. But a deselection has no influence on this list; deselected rows remains in it. Only...

How to Block UI based on method value

jsf,primefaces,dialog,blockui
I need your help in blocking the form based on the returned value from the method UpdateDatatable that will return "Yes", if commandButton "Print" is fired. If it is fired, I need to block the UI on the close of the dialog, otherwise not to block it. Currently my code...

Primefaces push

jsf-2,primefaces
I would like to use 'primefaces push' in my web application to receive notifications. I would like that a user could receive notifications depending on the groups he belongs to. Every user can belong to several groups, for example: User X belongs to Group A and B. User Y begong...

adjust the rows dynamically in paginator of primefaces datatable

primefaces,datatable
I am using the primefaces datatable paginator. I have fixed the to no of rows to 15. This correctly matches the my system resolution. But users are using monitors with different(bigger) resolutions. The no of rows in this case will be less and space will be displayed at the bottom....

How to do ThemeSwitcher using Primefaces

jsf,jsf-2,primefaces
This is the demo that i'm trying to do. http://www.primefaces.org/showcase/ui/misc/themeSwitcher.xhtml My HTML code: <h:form > <h:panelGrid columns="2" cellpadding="10"> <h:outputText value="Basic:"></h:outputText> <p:themeSwitcher effectSpeed="normal" effect="fade" style="width:165px" id="defaultSwitcher" value="#{themeSwitcherBean.theme}"> <f:selectItem itemLabel="Choose Theme" itemValue="" /> <f:selectItems value="#{themeSwitcherBean.themes}" /> <p:ajax global="false"...

JSF 2: Stop rendering if validation fails [duplicate]

ajax,jsf-2,primefaces
This question already has an answer here: Can I update a JSF component from a JSF backing bean method? 1 answer JSF validate on submit form 1 answer I'm using primefaces. I have a form and a dataTable with a lazyModel, in the dataTable I show the results found...

Primefaces How to show/hide inputText based on selected selectManyCheckbox items [duplicate]

jsf,primefaces
This question already has an answer here: Ajax update/render does not work on a component which has rendered attribute 1 answer I need your assistance in showing and hiding inputText based on the selected items in the selectManyCheckboxin the xhtml. The code is: <p:selectManyCheckbox id="basic" value="#{user1.selectedConsoles}"> <f:selectItem itemLabel="Xbox One...

Remove link outline from p:tabView

css,jsf,primefaces
Is there a way to remove the outline, when an user click on one of the <p:tabView> tabs? Set it in CSS did not help. a { outline: 0 none !important; } Here is a screenshot. ...

spring mvc- primefaces: pagination does not working

spring,jsf,primefaces,datatable,bootstrap
I use Spring and primefaces. I have manageBean:{ @ManagedBean @RequestScoped public class OrderListView implements Serializable{ private static Logger LOG = Logger.getLogger(OrderListView.class.getName()); private List<Project> projects; public void setForums(List<Forum> forums) { this.forums = forums; } @PostConstruct public void init() { System.out.println("A new backing bean has been created"); projects = new ArrayList<Project>(); projects.add(new...

Primefaces datatable duplicate “No records found” while doing column freeze for empty records

jsf,jsf-2,primefaces,datatable
I am using primefaces <p:datatable> to freeze some of my columns.Everything is fine but when there are no records in then it gives two "No records found" message.This is weird situation.Do anyone have come across this problem? Suggestions are welcome.I want only one "No records found " message. <p:dataTable var="car"...

p:selectCheckboxMenu highlight list item when mouse is over an item

css,primefaces
I know p:selectCheckboxMenu has all its style classes, but i want to change something. I would want that when i open the menu and move with the mouse over an item, it will be highlighted in blue. I want it to be highlighted only when the mouse is over that...

Ajax update of datatable from a modal after filtering

ajax,jsf,primefaces,datatable
My question is very similar to this: Ajax update doesn't work, when using filter on datatable (JSF, Primefaces). I have a dataTable with an "Open" button (a commandButton) for each entry/row in the table, on click of which, a dialog will open. I have a form in the dialog that...

Refresh parent node from backing bean with primefaces tree

jsf,primefaces,tree
Currently I am working on a project that use primefaces 3.4.1 version which does not support drag and drop in tree component. So I am using a contextMenu instead of drag and drop. <p:tree id="treeHierarchy" value="#{hierarchyManagementBackingBean.root}" var="node" dynamic="true" selectionMode="single" cache="false" style="width:99%;" selection="#{hierarchyManagementBackingBean.selectedNode}"> <p:treeNode id="idtreenode"> <h:outputText value="#{node.name} (#{node.entityType})" /> </p:treeNode> </p:tree>...

binding on p:dataTable which is included multiple times causes ID unqiueness exceptions

jsf-2,primefaces,binding,datatable,facelets
I'm attempting to use a special PrimeFaces data exporter implementation as being used in this answer: http://stackoverflow.com/a/14413932/396732 Our use case however is a little more complex, e.g. using Facelets to show the respective datatable for export, which has row expansions with sub tables in them. insiderListManagerDialogs.xhtml: <ui:include src="insiderListManagerListDialog.xhtml"> <ui:param name="idPrefix"...

Primeface Datatable filtering removed when sorting with o:form includeRequestParams=“true”

primefaces,filter,datatable,omnifaces,http-request-parameters
this is an issue following this one: Primeface datatable.filter() and url parameter is use PrimeFaces-5.1 and omnifaces-2.1 to render a datatable with pagination, filtering and sorting while using request parameters. my datatable is constructed like this: <o:form includeRequestParams="true"> <p:dataTable id="hostStateHistoryTable" value="#{HostHistoryBean.hostStateHistoryList}" var="status" widgetVar="statusTable" filteredValue="#{HostHistoryBean.filteredHostStateHistoryList}" rowStyleClass="#{status.state eq 0 ? 'up' :...

JSF form needs to update a field

date,jsf,primefaces
I have a JSF form with 2 dates. Start Date is required. 2 things I would need: When the End date is filled in --> Then the Days should be calculated and filled in. When the Days are filled in (example: 31) --> Then the End date should be filled...

Value of must be an array or a collection (javax.servlet.ServletException)

java,primefaces
I am getting javax.faces.FacesException: Value of 'groupList 'must be an array or a collection error. I've googled for it, but I still don't get an idea as for me it seems I have a collection: it is List, also i see in debugger that it is populated. form.xhtml: <p:selectManyCheckbox id="groupList"...

p:fileUpload invalid size message is not localized according locale config

jsf,file-upload,primefaces,localization
When a user uploads files which is larger than the allowed size he gets a error-message in english and not the language which I set in faces-config.xml There are any special settings needed to display the error-message in the right language? The other error messages for example on the field...

How to override PrimeFaces CSS via external stylesheet

html,css,jsf,primefaces,el
I have the following code on my xhtml page to override default PrimeFaces styling: <h:body> <f:facet name="last"> <h:outputStylesheet library="css" name="main.css" /> </f:facet> ... </h:body> This works fine when I am using a stylesheet, that is stored locally on my server. The Problem is, that I want to include a external...

Does Primefaces-Mobile have a Schedule component?

primefaces,primefaces-mobile
I am intending to use primefaces-mobile to build a mobile web application for my org. I have used the schedule component which is available in primefaces framework for web applications. But is there a similar Schedule Component in primefaces mobile ?

primefaces: how to set dynamic oncomplete event value like oncomplete=“#backingbean.oncomplete”

jsf,primefaces
I would like to show different dialog from a single button depends on backingbean calculation. Like show a msg "Bill no has been paid already", if client enter a duplicate bill no, if the bill no is ok than shows like "Bill has been paid successfully". How can I achieve...

Primefaces: Dialog with inputTextarea not updating controller's variable

jsf,jsf-2,primefaces
I have this Dialog: <p:dialog header="Ingrese Comentario" widgetVar="dlg1" appendTo="@(body)" modal="true" position="top" hideEffect="fold" showEffect="fold" closable="true" draggable="true" > <h:form id="d_ingresarComentario"> <h:panelGrid columns="2"> <p:inputTextarea value="#{tareaController.comentarioNuevo.comentario}" rows="7" cols="60" placeholder="Ingrese su comentario aquí" counter="display1" maxlength="200" counterTemplate="{0} Caracteres faltantes." > </p:inputTextarea> <br/>...

How to make a downloadable commandLink for any content type (pdf/zip/docx/jpeg etc)

jsf,primefaces
I want to create a downloadable link.I use primefaces 5.0 and jsf 2.2.I have some files (pdf,zip/rar,docx,jpeg etc) and I want to share this files on data table with commandLink. Only available to download a file(have a specific content type) in google.(example:download only a pdf).But how can I do that...

confirmDialog is not taken the new value of the selectOneMenu

primefaces,selectonemenu
I need to change the status in database but when I change the status the confirmDialog is not taking the new value, it gets the old one <p:selectOneMenu converter="omnifaces.SelectItemsConverter" disabled="#{myBB.currentStatus != StatusEnum.TEMP}" id="statusSOM" onchange="PF('confirm').show();" value="#{myBB.currentStatus}" widgetVar="statusWV"> <f:selectItems itemDisabled="#{status == StatusEnum.ALL}" itemLabel="#{msgs[status.name]}" itemValue="#{status}" value="#{myBB.statusList}" var="status" /> </p:selectOneMenu>...

unselect the selected rows in a datatable

jsf,java-ee,primefaces
I'm working on a datatable with a single selection mode.My problem is that when I refesh the page , the same selected rows before refreshing stay refreshed. Any idea on how unselecting all datatable rows in this case. I appreciate helping me with this issue. This is my datatable code:...

Primefaces wizard - how to disable next/prev buttons animation?

jsf,primefaces
I have PrimeFaces wizard with some panels, and next/prev buttons is drawn by wizard widget itself... But there is one problem - when i press next button before the last step, it hides with animation... Is it possible to disable this animation and hide next button instantly?

how stick out a menu when clicking on a menu [on hold]

css,jsf,primefaces
I have a type of menu created in JSF. <p:menubar styleClass="menuPrincipal" id="menuBar" > <p:menuitem value="Inicio" url="/Inicio.xhtml" style="text-decoration:none" icon="ui-icon-home" id="inicio" /> <p:menuitem value="Agregar Excepciones" id="agregarExcepcion" url="/ExcepcionNuevo.xhtml" style="text-decoration:none" rendered='#{excepcionPendienteView.usuarioActual.tipoSolicitante eq "Administrador"}' /> </p:menubar> I want that when you click on a menu, highlight the option me where I am working. if I...

Cannot get custom component attribute from backing bean

jsf,primefaces,custom-component
I have the following custom PrimeFaces Panel In the page <x:myPanel panelName="TEST123" /> And the class @FacesComponent(namespace="test",tagName="myPanel", createTag=true) public class MyPanel extends Panel { public MyPanel() { panelName = (String)getAttributes().get("panelName"); } } Why when getting the attribute from the class itself does not work getAttributes().get("panelName"); >> it returns null I...

Primefaces commandButton is not showing dialog after ajax form refresh

ajax,jsf,primefaces
I need your help and guidance on fixing the issue of showing the dialog after refreshing the form by using ajax. I am having a dataTable that it is showing a number of requests and onclick of the commandButton view, a dialog will be shown that contains some information. And...

How to use line chart extender attribute in primefaces 5.2

javascript,jsf,primefaces,xhtml,jqplot
I'm using primefaces 5.2 latest version and tried for line chart,its working fine. Am trying to change the line chart axes color,background,border...etc.but extender attribute is not working in latest primefaces version. My XHTML: <p:chart type="line" model="#{chartViewLine.lineModel1}" styleClass="legendpos" extender="chartExtender" style="height:300px; width:570px;"/> JAVASCRIPT: function chartExtender() { this.cfg.grid = { background: 'transparent', gridLineColor:...

Primefaces 5.2 get jqplot instance from p:chart

primefaces,jqplot
I have p:chart on my site like this <p:chart id="chart" type="line" widgetVar="chart" model="#{resultsViewController.areaModel}" style="height:600px"/> Now I want the client to be able to modify some display options without reloading the page, in order to do that I need to acquire the jqplot instance. How can I do that? I read...

CommandButton execution while rendering

jsf,primefaces
Question: How can I prevent the execution of a while the website is rendering? Thats where my Button sits: <p:dialog widgetVar="newComment" height="200" width="500"> <h:form> <h:panelGrid> <h:outputText value="#{commentDialog.username}" /> <h:inputTextarea id="in_text" value="#{commentDialog.text}" /> <p:message for="in_text" /> </h:panelGrid> <p:commandButton validateClient="true" value="Abschicken" ajax="true" actionListener="#{popupRequestView.update}"...

primefaces treetable expand not working if jsf page location is changed

spring,jsf,spring-mvc,jsf-2,primefaces
Primefaces treetable expands if my xhtml webpage is in WebContent Folder but it doesn't expand if I move the same webpage to WEB-INF/views/jsf folder. I'm very new to JSF and I don't know where and what to change. If my webpage is in WEB-INF/views/jsf folder only the root node is...

Data List pagination primefaces mobile 5.2 not working

primefaces,pagination,primefaces-mobile
The pagination of my datalist is not working on primefaces mobile, it shows 1000 rows instead of 5! I changed my pf version from 5.1 to 5.2 and nothing happened. I checked the showcase and read the pf 5.2 guide and I don't find the solution. Here my code :...

SCRIPT5009: 'myfaces' is undefined

jsf,primefaces,internet-explorer-10,websphere-8,commandlink
I have JSF2 application running on WAS8.5.4 sever using libraries primefaces-3.4-SNAPSHOT-20120807.jar and javax.faces-2.1.9.jar . In one of the pages , I have p:commandlink button to view attached documents .But when users click on this component , the browser displays error SCRIPT5009: 'myfaces' is undefined .As a result, user is not...

In Primefaces picklist, how to find that an item is moved from TARGET to SOURCE, Using Omnifaces Converter

jsf,jsf-2,primefaces,omnifaces
I have looked around and could not find a solution. I am using Omnifaces listConverter in the PickList component of Primefaces. When I move an item from SOURCE to TARGET. In the backing bean i get the new item ONLY on dualList.getTarget(). However when I move an item from TARGET...

LazyInitializationException in selectManyCheckbox on @ManyToMany(fetch=LAZY)

jsf,jpa,primefaces,lazy-initialization,selectmanycheckbox
What is the best way to handle multiple chackboxes when you nead to fill a JPA M:N relation ... for example I have an JPA entity Hardware and the entity Connectivity. Hardware has a set for connectivity : private Set<Connectivity> connectivities = new HashSet<Connectivity>(0); and has a setter and getter...

Hide a datatable column without rerendering it. JSF Client side manipulation

jsf,primefaces
I used to develop rich client interface applications using Spring MVC mixed with jQuery and html; However, because we don't have a good designer currently, I thought to go with JSF 2.2 using PrimeFaces 5.2 which should give me professional interface without a regular designer. I have good knowledge about...

Primefaces p:remoteCommand parameter always null

primefaces,remotecommand
I am trying to pass a parameters with p:remoteCommand Unfortunately when I retrieve the paramer in my bean method I always get null. Is there anything wrong with my code? Here is my page code: <a href="#" onclick="rc([{'d':'01'}])">01</a> <p:remoteCommand name="rc" update=":myform:messages" actionListener="#{mybean.changedaybar}" /> and this is the bean method: public...

Preprocess/postprocess a bean action method from p:remoteCommand inside composite

jsf,jsf-2,primefaces,action,composite-component
I have the following scenario: JSF composite component with complex JavaScript, which I'd like to refresh partially by JavaScript with a new values from a backing bean (backing bean of a page which uses this composite component, not backing component @FacesComponent). I don't want to make full update because it's...

How to deactivate a JSF tag (Primefaces)

jsf,primefaces,jsf-2.2,blacklist
I use Primefaces 5.x (on myFaces 2.2.x) for my UI and I want to disable / deactivate some JSF tags like to avoid mistakes. Is there a blacklist or whitelist I can use?...

DynaForm Primefaces extensions gather submitted data

jsf,primefaces,primefaces-extensions
I am using DynaForm in Primefaces extensions. I have generated a dynamic form, but the problem is how to recover the submitted data from the controller. Here is how I am generating my form: this is the controller side model = new DynaFormModel(); DynaFormRow row; allfieldMessageList=getAllfieldMessageList(); for(FilledMessageField f:allfieldMessageList) { //...

Stuck thread at UIComponent.popComponentFromEL

multithreading,jsf,jsf-2,primefaces,components
My application uses JSF 2.1 with PrimeFaces. Recently, very high CPU Utilization was observed because of some stuck threads. The stuck thread dump for all stuck threads pointed to javax.faces.component.UIComponent.popComponentFromEL like below: javax.faces.component.UIComponent.popComponentFromEL(UIComponent.java:1934) javax.faces.component.UIComponent.visitTree(UIComponent.java:1633) javax.faces.component.UIComponent.visitTree(UIComponent.java:1623) org.primefaces.component.api.UIData.visitRows(UIData.java:741)...

PrimeFaces 5.1 filterFunction - is it possible to get the whole line from the table?

java,primefaces,datatable
I'm filtering my dataTable and want to filter it with custom function. The problem is, that I want to take as input two columns of datatable. Default signature for implementing filterFunction is public boolean filter(Object value, Object filter, Locale locale) and in value parameter it holds contents of whatever is...

Primefaces Dialog is not resetting selected values on second time view

primefaces,dialog
I am having a dataTable in my xhtml that will show the records and at the last column in the dataTable, I am having a commandButton that will display a dialog that has a selectOneMenu which the user can select the date and based on the date selection, the values...

Can I pass a custom parameter based on JSF event, as parameter to oncomplete function in p:ajax?

jsf,jsf-2,primefaces
I will try to explain myself: This is code: <p:ajax event="eventResized" process="@this calendar" listener="#{bean.eventResized}" oncomplete="resizeComplete()"/> eventReized invoked by EventResizeBehavior which extended from AjaxBehaviorEvent and it contains some property. Can I check inside <p:ajax....> call its value and pass result to oncomplete="resizeComplete(result)" Something like that <p:ajax event="eventResized" process="@this calendar" listener="#{bean.eventResized}" oncomplete="resizeComplete(#{eventResized.id...

p:tabMenu activeIndex becomes 0 after form submit

jsf,primefaces,menu
Both pages contains the header: <p:tabMenu activeIndex="#{param.i}"> <p:menuitem value="Overview" outcome="index" icon="ui-icon-star"> <f:param name="i" value="0" /> </p:menuitem> <p:menuitem value="Demos" outcome="second" icon="ui-icon-search"> <f:param name="i" value="1" /> </p:menuitem> </p:tabMenu> The second page contains a form: <h:form> <h:inputText id="name" value="#{name}" a:placeholder="What's your name?" /> <h:commandButton value="Submit" outcome="second" />...

Work at Primefaces Extensions Custom Exporter

jsf,primefaces
I have some dataTables on the web page and I'd like to export all to an excel file, like the web page images: I'd like to export the footer like showed in page. I try to use rendered and exportable,both with boolean attribute, but no way. What might be the...

Refresh/Redirect from backing bean when p:poll reaches certain condition

jsf,redirect,primefaces,ajax-polling
I'm implementing an auction system using jsf. in the item page, I have a countdown showing how much time is left for this sale. I show it with <p:outputlabel value=#{itemBean.timeToEnd()} />. the timeToEnd() method returns a string in the format: 1 days, 2 hours.. etc. it calculates it on a...

Why are fields reset after ajax update with Primefaces

ajax,jsf-2,primefaces
On a form I have some personal information (name, address etc.) and a changeListener which updates the salutation and letter salutation according to the gender and last name. If the underlying entity was already stored in the database it works fine. If I'm entering data for a new (not saved)...

selectonemenu defualt value does not work in table row editor

jsf,primefaces,selectonemenu
I have a p:selectOneMenu tag in a p:cellEditor tag of a table with roweditor. here is it's code: <p:column headerText="Update Interval"> <p:cellEditor> <f:facet name="output"><h:outputText value="#{news.intervalLabel}"/></f:facet> <f:facet name="input"> <p:selectOneMenu value="#{newsManagementBean.intervals}" valueChangeListener="#{newsManagementBean.changedIntervals}" style="width: 200px;"> <f:selectItems value="#{newsManagementBean.updateIntervals}" var="interval"...

Using JSF HTML5 friendly markup with other components libraries

html5,primefaces,jsf-2.2
Starting with JSF2.2, it is possible to write more elements in HTML5: writing <button> can be equivalent to writing <h:commandButton>. But how does this work with other components libraries? Is it possible to override that behaviour and let <button> be translated to a component from some library other than the...

selectonemenu, when editable=false, cannot submit the form

jsf,primefaces
My form is working if editable is set to true but not when it's false. When false the submit action method is not even called. I need it to be false (not editable so I can store the correct value in db). This is the menu I added. <tr><td> <h:outputLabel...

How to open an arbitrary URL in new window using a PrimeFaces button

jsf,primefaces
I have the below output link which does its job: <h:outputLink value="#{verDocumentoController.url()}" target="_blank"> show document </h:outputLink> It opens an URL obtained as a bean property in a new window. However, I'd like to turn the link into a button in PrimeFaces look'n'feel. I tried as below: <p:commandButton value="show document" action="#{verDocumentoController.url()}"...

PrimeFaces p:dataList issues error “Property 'ime' not found on type java.lang.String”

jsf,primefaces,datalist
I want to make Checkbox menu and display data in dataList. Here is my xhtml: <h:form> <h:panelGrid columns="3" cellpadding="5"> <h:outputLabel for="menu" value="Demonstratori :" /> <p:selectCheckboxMenu id="menu" value="#{nastavnik.odabraniDemonstratori}" label="Demonstratori:" filter="true" filterMatchMode="startsWith" panelStyle="width:250px"> <f:selectItems value="#{nastavnik.sviDemonstratori}" var="demons" itemLabel="#{demons.ime} #{demons.prezime}" itemValue="#{demons}" />...

@ViewScoped @PostContruct is called upon every ajax request

ajax,jsf,primefaces,view-scope
Using Primefaces 5.0, JSF 2.2.7, deployed on EAP 6.1. I have this Managed Bean below. import hh.bean.Service; import hh.dao.ServiceDao; import hh.dao.impl.ServiceDaoImpl; import java.io.Serializable; import java.util.List; import javax.annotation.PostConstruct; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; @ManagedBean @ViewScoped public class View1 implements Serializable { private static final long serialVersionUID = 1L; private ServiceDao serviceDao =...

disable/ enable primefaces components

jsf-2,primefaces
I want to disable some primefaces components after a selection from p:selectOneMenu but when I choose no selection option it still disabled <p:outputLabel value="Manager" style="color:white;font-weight: bold;" /> <p:selectOneMenu id="manager" value="#{employeeMB.selectedManager}" immediate="true"> <f:selectItem itemLabel="Selectionner..." noSelectionOption="true"/> <f:selectItems value="#{employeeMB.managers}" /> <p:ajax update="managerSelect role" /> </p:selectOneMenu> <p:outputLabel value="Est un...

jsf: redirecting from bean on primefaces ajax event

ajax,jsf-2,primefaces,url-redirection
I have this selectable PrimeFaces Tree with an Ajax listener on selection in my index.xhtml: <p:tree value="#{seccionesArbolView.root}" var="node" selectionMode="single" > <p:treeNode> <h:outputText value="#{node.nombre}" /> </p:treeNode> <p:ajax event="select" listener="#{seccionesArbolView.onNodeSelect}"></p:ajax> </p:tree> The listener method is on a session scoped named bean, and should redirect to another page (grupal.xhtml) with some GET parameters....

PrimeFace dataTable with variable columns and specific editable cells

jsf,primefaces
I need to create a table where the headers list are brought from a model. The table contents are also stored in the model and p:dataTable loop on the data to show the content based on the column name. The issue is that I need to make some specific cells...

Get p:dataTable row data via p:selectOneMenu

jsf-2,primefaces,datatable,row,selectonemenu
I have a dataTable which one of the columns contains a selectOneMenu (a.k.a dropDownList). Basically each row has a selectOneMenu which has a list of values. Is there a posibility to pass the row data or key whenever the selectOneMenu value has been selected? This way I can loop through...

Include different file with primefaces

java,primefaces
I'm trying to include different file according to the type of my java object. I'm doing something like that : <p:panelGrid rendered="#{adapter.habitation}" > <ui:include src="./habitation.xhtml" /> </p:panelGrid> <p:panelGrid rendered="#{adapter.animas}"> <ui:include src="./animals.xhtml" /> </p:panelGrid> But all my cases throw an exception because it's trying to resolve all xhtml files. Any idea...

Dynamic rendering - unable to find component with clientId

jsf-2,primefaces
I am rendering a xhtml to a dialog whose components are added dynamically from server side using Dynamic example. Using PrimeFaces 5.1, JSF 2.1 Mojarra and tomcat 7. When i click the close button of the pop up a large number to of unable to find the component is being...

p:inputText size attribute doesn't limit allowed text length

primefaces
I am using p:inputText and the size attribute does not effectively limit the number of allowed characters in the field: <p:inputText id="limitedField" title="Limited Field" size="16" required="true" styleClass="plainInput" value="#{entity.limitedField}" /> First of all, the user is physically allowed to enter more 16 characters. Secondly, when they do, instead of a graceful...

Append CSS style from a bean

jsf,primefaces
Is it possible to append a style during @PostConstruct of a component, for example to a CommandButton. Change the style class is here no way because I need dynamic values. I tried the following which resets the style of the Button UIViewRoot root = FacesContext.getCurrentInstance().getViewRoot(); CommandButton button = (CommandButton)root.findComponent("form:btn1"); button.setStyle("background-color:...

How to just update “rendered” property in JSF

ajax,jsf,primefaces,facelets
I've got a list of documents and I need to update all at once. I did something like this: <ui:repeat id="r_list" value="#{tareaController.controlador.documentosIndexar}" var="documentos" > where documentosIndexar is the list of documents. It displays all the documents and its properties fine. I have two panelGrids, one with the viewer of the...

Primefaces datatable combine data in only one row

jsf,primefaces,datatable
I am using tomcat8 and primefaces 5.1 and I have the following code: <p:dataTable var="price" value="#{HOTEL.hotel}"> <p:column headerText="Тип стая"> <h:outputText value="Единична" /> <h:outputText value="Двойна" /> <h:outputText value="Апартамент" /> <h:outputText value="Студио" /> </p:column> <p:column headerText="Брой"> <h:outputText value="#{HOTEL.hotel.room_1}" /> <h:outputText value="#{HOTEL.hotel.room_2}" /> <h:outputText...

How to refresh the page after closing p:dialog

jsf,primefaces,dialog,page-refresh
I've the below dialog: <h:form id="r1"> <p:commandButton value="Basic" type="button" onclick="PF('dlg1').show();" /> <p:dialog header="Basic Dialog" widgetVar="dlg1"> <h:outputText id="test" value="Welcome to PrimeFaces" /> </p:dialog> </h:form> How can I refresh the JSF page after closing the dialog?...

CDI Bean member loses value during request

jsf-2,primefaces,cdi
I have years of experience developing JSF applications, but this is a confusing bug, which is driving me insane. I think I need a fresh pair of eyes to find the possible error. First off, the details about the environment: JDK: 8u40 Server: WildFly 8.2.0.Final Libs: CDI 1.2, JSF 2.2,...

p:layout and p:layoutUnit ignore the style

css,jsf,primefaces
My question is quite simple. I'm using PrimeFaces 4.0 and the layout component. The problem comes, when I try to adjust its CSS. I want to set its background to none, I tried the classic style="background: none !important but it ignores me, then I inspect the element in Google Chrome...

javax.el.PropertyNotFoundException: /tab.xhtml @65,50 value=“#{stackElement.name}”: The class 'java.lang.String' does not have the property 'name'

jsf,primefaces
If I add stackElemen first time it's ok, the output is: list size = 1 But after adding second element I get error: Error Rendering View[/tab.xhtml]: javax.el.PropertyNotFoundException: /tab.xhtml @65,50 value="#{stackElement.name}": The class 'java.lang.String' does not have the property 'name'. ... Caused by: javax.el.PropertyNotFoundException: The class 'java.lang.String' does not have the...

Update component in a different window/tab without manually refreshing it

forms,jsf-2,primefaces,commandbutton
I have different pages with different layouts, for example index.xhtml and user.xhtml, each page has it's own template. If I make a change in user.xhtml I want to update a datatable in index.xhtml. index.xhtml: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:p="http://primefaces.org/ui"> <ui:composition template="/template.xhtml"> <ui:define name="body"> <h:form id="indexFormId">...

Access particular row of p:datatable in Backing Bean on click of h:CommandLink without binding attribute

jsf,jsf-2,primefaces,datatable
Please find my code below for p:datatable having h:commandlink as one of its column: <p:dataTable id="listTable" value="#{listBean.lazyDatalist}" var="list" paginator="true" paginatorPosition="top" rows="10" rowIndexVar="rowIndex" rowStyleClass="#{(rowIndex mod 2) eq 0 ? 'rowStyleOdd' : 'rowStyleEven'}" lazy="true"> <p:ajax event="page" listener="#{listBean.searchLazyData}"/> <p:column style="width:3%;" headerText="#{msg['userlist.dt.srNo']}"> <h:outputText value="#{list.orderCount}"></h:outputText>...