jsf-2

Display p:fileUpload invalidFileMessage outside component inside e.g. p:messages or p:growl

一个人想着一个人 提交于 2019-12-12 18:06:27
问题 I have Facelets file: <h:body> <ui:composition template="...."> <h:form id="templateEditor"> <p:growl id="growl" sticky="true" showDetail="true" autoUpdate="true" widgetVar="growl"/> <h:outputScript library="js" name="ckeditor.js" target="head" /> <body onload="onloadInput();"/> <p:tabView> <p:tab title="...." > <p:datagrid id="..." /> <p:fileUpload id="fileUpload" skinSimple="true" label="..." auto="true" allowTypes="/(\.|\/)(jpg|jpeg|png|bmp)$/" sizeLimit="5000000" invalidFileMessage="#..."

JSF 2.0, Bean Validation and labels

て烟熏妆下的殇ゞ 提交于 2019-12-12 17:33:10
问题 How can I show the field label in a JSF error message when bean validation is used? <h:messages/> <h:inputText label="Username" value="#{myBean.username}" /> ... public class MyBean { @NotNull private String username; ... } If no user name is submitted only "Must not be null" is shown and there is no field reference. 回答1: To display the concerned component's label in the error message define a new value for the property javax.faces.validator.BeanValidator.MESSAGE in a resource bundle of the

Primefaces selectManyMenu default selection

喜你入骨 提交于 2019-12-12 17:29:14
问题 Does p:selectedManyManu allow default selection? I have been unable to implement this. I even tried Omnifaces ListConverter and selectItemsConverter without success. Any help or pointer is appreciated. More than one item could be selected by default when the page loads. here is my code: POJO: public class LocationRef implements Serializable{ private integer Seqid; private String locname; private String locaddress; private String phonenumber; //getters and setters //tostring //equals, hashcode

Pass source HTML element to oncomplete function of PrimeFaces p:ajax

主宰稳场 提交于 2019-12-12 17:24:32
问题 I would like to pass the source HTML element as argument to JavaScript callback function of <p:ajax oncomplete> . I tried passing this which usually works in onclick and such: <p:ajax ... oncomplete="callbackFunction(this)" /> It's not working. It seems to be a different object. How can I achieve this? 回答1: In context of oncomplete , the this represents the PrimeFaces ajax object which actually contains a lot of information. You could easily have figured out it by inspecting the object in

@PostConstruct Interceptor with @Named @ViewScoped not invoked

十年热恋 提交于 2019-12-12 17:22:53
问题 I have read carefully the article about Interceptors in the Seam/Weld documentation and implemented a InterceptorBinding : @InterceptorBinding @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.TYPE}) public @interface MyLog {} and a Interceptor class: @MyLog @Interceptor public class ErpLogInterceptor implements Serializable { @AroundInvoke public Object logMethodEntry(InvocationContext invocationContext) throws Exception {..} @PostConstruct public Object

Selecting a row in sorted rich:dataTable

你。 提交于 2019-12-12 16:44:07
问题 I have a rich:dataTable component (RF 4.2.2.Final). I've added the rowclick listener for the table to update a detailed view based on the row selection. Everything was working fine. But now I'm trying to get my dataTable to have sortable headers. I follow the RF showcase and find out that the row selection doesn't work properly if the data in the dataTable isn't in natural order - it means in order in which the data is in the list in appQueryBean. But I'm sure that similar case is fine in RF

How to open JSF page using JAX-RS web service?

 ̄綄美尐妖づ 提交于 2019-12-12 16:30:11
问题 I would like other web application (in .net or any other) to call my JAX-RS web service to set and open my JSF page with some passed values. E.g. Another web application just pass the userId and a token to open an entry page. User will complete the entry and service will return the uniqueId for created entry. I am confused in how I can set JSF context parameters and open that JSF page using JAX-RS. Can anyone give idea about how to set value of JSF session scoped managed bean using web

java.lang.StackOverflowError Running JSF 2 example on Weblogic 12c

偶尔善良 提交于 2019-12-12 16:02:05
问题 I followed the very basic tutorial found here example and cannot seem to get past the following error: Error 500--Internal Server Error java.lang.StackOverflowError at weblogic.servlet.internal.ServletResponseImpl.addHeader(ServletResponseImpl.java:567) at javax.servlet.http.HttpServletResponseWrapper.addHeader(HttpServletResponseWrapper.java:200) at javax.servlet.http.HttpServletResponseWrapper.addHeader(HttpServletResponseWrapper.java:200) at javax.servlet.http.HttpServletResponseWrapper

JSF 2.1 Ajax autocomplete + server search only after user stops typing

核能气质少年 提交于 2019-12-12 15:35:42
问题 I'm developing a autocomplete solution with a database search based on typing events (onkeyup) that the user inputs in a <h:inputText /> . The problem is that i have two pre-conditions that the application must attend to do a server-side search: The text informed is >= 3 and <= 6 characters User stopped typing for a few miliseconds (Preventing overload the server with to much search) Without the item 2) it's pretty simple do solve that just adding something like onkeyup="return checkInputs

JSF2.0 tags not found

心不动则不痛 提交于 2019-12-12 15:23:32
问题 Recently I've been playing around with JSF2.0+Richface 3.3.3, I'm using STS as my IDE and Maven to build my project, but somehow I can't get the following JSF2.0 tags to work: h:button h:link f:metadata f:viewParam (this is the only one my STS autocomplete recognizes) It just fails during runtime saying it can't find X component. I do have jsf-api-2.0.2, jsf-impl-2.0.2, richfaces-api-3.3.3.final, richfaces-impl-jsf2-3.3.3.final, richfaces-ui-3.3.3.final, jsf-facelets-1.1.15, jstl-1.0 and