primefaces

Opening a new window if condition true in managed bean

廉价感情. 提交于 2020-04-11 10:56:30
问题 I want to implement a situation where the user enter a URL, and if a specified condition is true in my managed bean this URL will be opened in a new web page. I found this possibility: The “h:link” tag is useful to generate a link which requires to interact with the JSF “outcome” , but lack of “action” support make it hard to generate a dynamic outcome. The “h:commandLink” tag is suck, the generated JavaScript is really scary! Not recommend to use this tag, unless you have a solid reason to

multipart/form-data enctype ignored

梦想与她 提交于 2020-03-26 07:52:09
问题 I have defined a form as multipart/form-data enctype. When I press a command button the request is not send with 'multipart/form-data' content-type. <h:form id="form" method="post" enctype="multipart/form-data"> <input type="file" ></input> <p:commandButton id="save" icon="saveBt" value="#{msgs.saveBt}" ... /> </h:form> In the developer tools console I can see the Content-Type as application/x-www-form-urlencoded; charset=UTF-8. I'm working with JSF 2.1 and Primefaces 5.1. Thanks 回答1: You are

Add icon (e.g. material design or Prime Icons) to a p:inputText

旧街凉风 提交于 2020-03-16 07:01:48
问题 I want to add an icon for an input text element, in a JavaEE project: <h:panelGroup styleClass="md-inputfield"> <p:inputText id="name" value="#{createCustomerView.customer.name}" required="true" label="Nome" requiredMessage="inserisci il nome"> <f:validateLength minimum="2" /> </p:inputText> <p:outputLabel for="name" value="Nome" /> <p:message for="name" display="icon" /> </h:panelGroup> How Can add an icon, like a person icon? 回答1: You can make use of Primefaces input group. refer https:/

未调用commandButton / commandLink / ajax操作/侦听器方法或未设置/更新输入值

你。 提交于 2020-03-07 20:03:00
有时,当使用 <h:commandLink> , <h:commandButton> 或 <f:ajax> ,与标签关联的 action , actionListener 或 listener 方法根本不会被调用。 或者,不使用提交的 UIInput 值更新Bean属性。 有哪些可能的原因和解决方案? #1楼 尽管我的回答并非100%适用,但是大多数搜索引擎都将其作为第一匹配,但我还是决定将其发布: 如果您使用的是 PrimeFaces (或类似的API) p:commandButton 或 p:commandLink ,则可能忘记了将 process="@this" 显式添加到命令组件中。 如《 PrimeFaces用户指南》第3.18节所述, process 和 update 的默认值均为 @form ,这与您可能从纯JSF f:ajax 或RichFaces中获得的默认值完全相反,它们是 execute="@this" 和 render="@none" 分别为 render="@none" 。 只是花了我很长一段时间才能找到答案。 (...而且我认为使用不同于JSF的默认值相当不明智!) #2楼 我自己陷入了这个问题,并找到了导致该问题的另一个原因。 如果在后备bean中没有用于* .xhtml中使用的属性的setter方法,那么就不会调用该操作。 #3楼 介绍 每当

p:dataTable and MalformedByteSequenceException

做~自己de王妃 提交于 2020-03-04 23:06:19
问题 I receive this error when I try to add the tag p:dataTable on my project: An Error Occurred: Byte non valido 1 della sequenza UTF-8 a 1 byte. - Stack Trace com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Byte non valido 1 della sequenza UTF-8 a 1 byte. at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:687) at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:557) at com.sun.org.apache.xerces.internal.impl

How to use OmniFaces @Eager annotation with PrimeFaces?

泄露秘密 提交于 2020-03-04 07:08:50
问题 PrimeFaces and OmniFaces can be used together in a JSF project. My project is using PrimeFaces 6.1 and works fine. However simply declaring the Maven dependency for OmniFaces <dependency> <groupId>org.omnifaces</groupId> <artifactId>omnifaces</artifactId> <version>2.6.7</version> </dependency> doesn't cause the @Eager annotation an application scoped bean injected with @Named to have any effect. Afaik instructions for CombinedResourceHandler don't solve this problem because it's an injection

How to use OmniFaces @Eager annotation with PrimeFaces?

本小妞迷上赌 提交于 2020-03-04 07:08:19
问题 PrimeFaces and OmniFaces can be used together in a JSF project. My project is using PrimeFaces 6.1 and works fine. However simply declaring the Maven dependency for OmniFaces <dependency> <groupId>org.omnifaces</groupId> <artifactId>omnifaces</artifactId> <version>2.6.7</version> </dependency> doesn't cause the @Eager annotation an application scoped bean injected with @Named to have any effect. Afaik instructions for CombinedResourceHandler don't solve this problem because it's an injection

select all in datatable jsf primefaces

帅比萌擦擦* 提交于 2020-02-28 15:05:34
问题 Im trying to create a select all button or check box that when clicked all the selectbooleanCheck boxes will be checked. is there no straight forward easy way.ive started creating the selectcheckbox that will when changed selectAll. thanks <p:dataTable value="#{illRequestModel.list}" var="illRequestRecord" width="100%" styleClass="request-table" rows="10" paginator="true" id="requestGrid" currentPageReportTemplate="Viewing Page {currentPage}" paginatorTemplate="{CurrentPageReport} {PageLinks}

Primefaces TabView does not maintain selectOneMenu Values

我们两清 提交于 2020-02-28 06:42:27
问题 Hi I have a primefaces tabView looks like this <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui"> <h:head></h:head> <h:body> <p:messages /> <h:form id="form"> <p:tabView dynamic="true"> <p:tab title="Tab"> <p

Primefaces dataTable: Is it possible to conditionally show a button? [duplicate]

心已入冬 提交于 2020-02-25 04:34:26
问题 This question already has answers here : Conditionally displaying JSF components (2 answers) Closed 3 years ago . I have a dataTable and there is a button in the last column. Depending on the data in the first column, I need the button to be either a simple button or a splitButton (offering more actions). Is there a way to achieve this ? My dataTable: <p:column headerText="id"> <h:outputText value="#{myvar.id}" /> </p:column> <p:column> <p:splitButton value="View" actionListener="#{bean