primefaces

How do you update the page size of a PrimeFaces datatable dynamically?

霸气de小男生 提交于 2021-02-08 10:38:27
问题 I am trying to update the page size of a PrimeFaces datatable dynamically, after the datatable is displayed on the page but I can't seem to be able to do that. I am using a lazy loaded datatable if that matters... putting an EL expression in the rows attribute and doing a table refresh does not work and causes the paginator to return no data. Any ideas if this is a bug and how to fix it? Thanks 回答1: You need not refresh or update the datatable. Use EL expression in rowsPerPageTemplate

How do you update the page size of a PrimeFaces datatable dynamically?

偶尔善良 提交于 2021-02-08 10:38:21
问题 I am trying to update the page size of a PrimeFaces datatable dynamically, after the datatable is displayed on the page but I can't seem to be able to do that. I am using a lazy loaded datatable if that matters... putting an EL expression in the rows attribute and doing a table refresh does not work and causes the paginator to return no data. Any ideas if this is a bug and how to fix it? Thanks 回答1: You need not refresh or update the datatable. Use EL expression in rowsPerPageTemplate

How to set defalult selected items in selectOneRadio/selectCheckboxMenu by beans in primefaces

萝らか妹 提交于 2021-02-08 07:55:45
问题 I want to create selectOneRadio list and selectCheckboxMenu which items get from related bean objects. For non selected list it is working well.But how can i provide these lists with some item(s) selected by default. My current selectCheckboxMenu code is like this. <p:selectCheckboxMenu id="trdays" value="#{mybean.selectedDay}" label="Select Days"> <f:selectItems value="#{mybean.dayList}" var="day" itemValue="#{day.value}" itemLabel="#{day.name}"/> </p:selectCheckboxMenu> it should look like

bean validation (JSR 303) for primefaces not working

十年热恋 提交于 2021-02-08 06:52:39
问题 I'm using: Primefaces 6.1 JSF: 2.2.10 javax.validation:1.1.0.Final validator impl: hibernate-validator 5.0.1.Final GAE: 1.9.52 I follow the example for CSV (Client Side Validation) using backend bean from: https://www.primefaces.org/showcase/ui/csv/bean.xhtml The expected result should be: And what I get right now: The bean validation is not working. I have below configure in web.xml <context-param> <param-name>primefaces.CLIENT_SIDE_VALIDATION</param-name> <param-value>true</param-value> <

p:dialog not hidden on validation failure

拈花ヽ惹草 提交于 2021-02-08 06:34:24
问题 I am having a problem with not closing a PrimeFaces dialog. The input field 'username' is required: <p:outputLabel for="username" value="Username: "/> <p:inputText id="username" value="#{employeeController.employee.username}" required="true"/> I used the following code to prevent the dialog from closing if the field is empty: <p:commandButton value="Save" action="{employeeController.doSaveEmployee()}" oncomplete="if (args && !args.validationFailed) PF('employeeAddDialog').hide()" update="

JSF / primefaces eventing in diagram elements

允我心安 提交于 2021-02-08 06:15:07
问题 i need to access the data object of an org.primefaces.model.diagram.Element in a managedBean on click of this very element. I am using primefaces 5.2. I tried multiple ways to establish this, but none did work so far. Here is one approach: xhtml: the idea is, to pass the element through a commandLink action attribute (which works fine for e.g. data tables): <fl:composition template="/WEB-INF/template.xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:fl=

JSF / primefaces eventing in diagram elements

孤街醉人 提交于 2021-02-08 06:14:15
问题 i need to access the data object of an org.primefaces.model.diagram.Element in a managedBean on click of this very element. I am using primefaces 5.2. I tried multiple ways to establish this, but none did work so far. Here is one approach: xhtml: the idea is, to pass the element through a commandLink action attribute (which works fine for e.g. data tables): <fl:composition template="/WEB-INF/template.xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:fl=

how to iterate Map<String,Collection> in datatable in primefaces

回眸只為那壹抹淺笑 提交于 2021-02-07 19:14:20
问题 Using JSF 2.1 with primefaces class FOO{ String name; String value; public void setName(String name){ this.name=name; } public String getName(){ return this.name; } public void setValue(String value){ this.value=value; } public String getValue(){ return this.value; } } I have an Map<String, List<FOO>> Header name should be Key of the Map. I need to create multiple columns (i.e. size of Map) and each column should have the list of FOO to display FOO.Name in rows. For Example : if size of map

how to iterate Map<String,Collection> in datatable in primefaces

醉酒当歌 提交于 2021-02-07 19:14:06
问题 Using JSF 2.1 with primefaces class FOO{ String name; String value; public void setName(String name){ this.name=name; } public String getName(){ return this.name; } public void setValue(String value){ this.value=value; } public String getValue(){ return this.value; } } I have an Map<String, List<FOO>> Header name should be Key of the Map. I need to create multiple columns (i.e. size of Map) and each column should have the list of FOO to display FOO.Name in rows. For Example : if size of map

Primefaces calendar does not readjust its position on window rotation

坚强是说给别人听的谎言 提交于 2021-02-07 14:16:37
问题 I am struggling with a primefaces calendar problem on a webpage rendered on a mobile device (tablet). It seems that the css values calculated by primefaces to show the popup calendar are not recalculated on window rotation (you need to click on it again to recalculate). Here is an example: I have my webpage displayed in portrait mode. I clicked the calendar icon and the position of the popup is good: (notice the css with left: 719.406px, calculated by primefaces). Everything OK so far. Now I