jsf-2

JSF 2: How show different ajax status in same input?

眉间皱痕 提交于 2019-12-28 02:03:26
问题 I would like to validate every field in my form when each field lose the focus, when this happens i would like these actions happen: 1) in the right side of the field appears an image, a .gif (to represent that the system is checking the user input) 2) when finished appears another .gif (which depends of the input, 'sucess.gif' or 'error.gif', for example) and a message on the right side. I don't want to use popup or something like, the user is gonna lose usability and i don't want this. I'm

JSF 2.0 set locale throughout session from browser and programmatically [duplicate]

孤者浪人 提交于 2019-12-27 12:22:24
问题 This question already has answers here : Localization in JSF, how to remember selected locale per session instead of per request/view (5 answers) Closed 4 years ago . How do I detect the locale for an application based on the initial browser request and use it throughout the browsing session untill the user specifically changes the locale and how do you force this new locale through the remaining session? 回答1: Create a session scoped managed bean like follows: @ManagedBean @SessionScoped

JSF 2.0 set locale throughout session from browser and programmatically [duplicate]

╄→尐↘猪︶ㄣ 提交于 2019-12-27 12:21:54
问题 This question already has answers here : Localization in JSF, how to remember selected locale per session instead of per request/view (5 answers) Closed 4 years ago . How do I detect the locale for an application based on the initial browser request and use it throughout the browsing session untill the user specifically changes the locale and how do you force this new locale through the remaining session? 回答1: Create a session scoped managed bean like follows: @ManagedBean @SessionScoped

Why JSF form maintain the validation styles even if has values on it?

蓝咒 提交于 2019-12-25 18:59:07
问题 I have a form (frmAddPax) to add some users data. This data could be submited manual or vía a barcode reader. When the button "Escanear" is pressed this one calls a dialog with another form (frmScan). This form read some data from a barcode reader and this data is processed in the managed bean. The data creates an object that is used in the original form (frmAddPax). The problem is all the form has the styling as there wasn't any data on it, all the mandatory fields have the required="true"

I'm getting warning from PostConstruct annotated init method

喜夏-厌秋 提交于 2019-12-25 18:33:17
问题 I'm getting this warning from @PostConstruct annotated init method Nis 18, 2014 2:46:10 PM com.sun.faces.vendor.WebContainerInjectionProvider getAnnotatedMethodForMethodArr WARNING: JSF1047: Method 'public void com.revir.managed.bean.PickListBean.init() throws java.lang.Exception' marked with the 'javax.annotation.PostConstruct' annotation cannot declare any checked exceptions. This method will be ignored. So my method is ignored, what do I have to do to fix this problem ? package com.revir

Can I nest a composite component in itself recursively?

回眸只為那壹抹淺笑 提交于 2019-12-25 17:03:10
问题 I have DTO which contains itself (it is nested). public class MyDTO { private SomeData someData; private MyDTO nested; // getters and setters } I created composite component, which is calls itself recursively. I call it like this: <screen:my-dto-screen dto="#{myDTOBean.myDto}" /> The definition is: <composite:interface> <composite:attribute name="dto"/> </composite:interface> -- display "someData" here -- <p:panel rendered="#{cc.attrs.dto.nested != null}" /> -- this acts as recursion bottom -

Get rewritten URL with query string

半城伤御伤魂 提交于 2019-12-25 16:57:41
问题 I'm using tuckey URL rewriting with JSF. I would like to get the relative URL including parameters that the user sees: e.g. example.com/mypage?param=test At the moment if I do #{view.viewId} I get mypage.xhtml what I want to get is: mypage?param=test 回答1: The UIViewRoot#getViewId() returns the JSF view ID. You need to use HttpServletRequest#getRequestURI() to obtain the current request URI and HttpServletRequest#getQueryString() to obtain the current request query string. #{request.requestURI

Clicking text in tr:selectbooleanradio not generating valueChangeEvent

谁都会走 提交于 2019-12-25 16:56:12
问题 In my JSF 2.0(MyFaces 2.1.10, Trinidad 2.1.0 Version)Application, I need to use tr:selectbooleanradio in my page to achieve the functionality that my page requires. In the below code, the default values of todaySelected and tomorrowSelected are 'false'. The issue is, once page loads, when I select 'today', the valueChangeToday is not getting called.(I believe it should call as default value of todaySelected is false and submitted value is true). When I select tomorrow, valueChangeToday is

Get rewritten URL with query string

て烟熏妆下的殇ゞ 提交于 2019-12-25 16:55:24
问题 I'm using tuckey URL rewriting with JSF. I would like to get the relative URL including parameters that the user sees: e.g. example.com/mypage?param=test At the moment if I do #{view.viewId} I get mypage.xhtml what I want to get is: mypage?param=test 回答1: The UIViewRoot#getViewId() returns the JSF view ID. You need to use HttpServletRequest#getRequestURI() to obtain the current request URI and HttpServletRequest#getQueryString() to obtain the current request query string. #{request.requestURI

Download user selected file/upload a file to a user selected directory both with primefaces

喜你入骨 提交于 2019-12-25 16:45:02
问题 I want to download user selected files with primefaces. I was able to do so for a specific file as described in the primface showcase for "file Download". But what I actually want is, that after pressing the "download Button" a file dialog should open, so the user can select a file for himself to download. Is that possible? My current code for a specific file download lokks like this: public void handleLanguageFileDownload() throws FileNotFoundException, IOException { FacesContext fc =