jsf-2

JSF2: How are the *.taglib.xml files discovered in jsf-impl.jar?

寵の児 提交于 2021-02-07 09:17:11
问题 In jsf-impl.jar (which can be found on mvnrepository.com), the *.taglib.xml files are located in directory com/sun/faces/metadata/taglib/ . I don't understand how they're discovered in this case, because chapter 10.3.2 of the JSF 2 specification says: 10.3.2 Facelet Tag Library mechanism ... The run time must support two modes of discovery for Facelet tag library descriptors Via declaration in the web.xml, as specified in Section 11.1.3 “Application Configuration Parameters” Via auto

Update a component in parent window from a dialog of PrimeFaces Dialog Framework

倖福魔咒の 提交于 2021-02-07 07:56:11
问题 I am using PF dialog framework to open a dialog. public void addSpecFeatures(){ genericFeatures = new GenericFeatures(); Map<String,Object> options = new HashMap<String, Object>(); options.put("resizable", false); options.put("draggable", false); options.put("modal", true); options.put("widgetVar", "featureDialog"); RequestContext.getCurrentInstance().openDialog("PAGEName", options, null); } From the dialog I would like to update a component in the parent page. So, I tried below code public

Update a component in parent window from a dialog of PrimeFaces Dialog Framework

南楼画角 提交于 2021-02-07 07:55:57
问题 I am using PF dialog framework to open a dialog. public void addSpecFeatures(){ genericFeatures = new GenericFeatures(); Map<String,Object> options = new HashMap<String, Object>(); options.put("resizable", false); options.put("draggable", false); options.put("modal", true); options.put("widgetVar", "featureDialog"); RequestContext.getCurrentInstance().openDialog("PAGEName", options, null); } From the dialog I would like to update a component in the parent page. So, I tried below code public

How to start special init event in a backing bean before JSF page loads?

僤鯓⒐⒋嵵緔 提交于 2021-02-07 04:04:38
问题 PF 3.5.10, Mojarra 2.1.21, Omnifaces 1.5 How to call special init()-method of some (CDI)SessionScoped bean before I load a .xhtml JSF page ? Now I call init() if user select the page from site menu (with p:menutitem ). But what to do if the user use browser address line to type url directly? Edit: my.xhtml : <ui:define template="/mytemp.xhtml"> <f:event type="preRenderView" listener="#{mybean.init()}" /> <h:form> <p:commandButton update="@form" ... /> </h:form> </ui:define> If I do it that

How to start special init event in a backing bean before JSF page loads?

不打扰是莪最后的温柔 提交于 2021-02-07 04:01:58
问题 PF 3.5.10, Mojarra 2.1.21, Omnifaces 1.5 How to call special init()-method of some (CDI)SessionScoped bean before I load a .xhtml JSF page ? Now I call init() if user select the page from site menu (with p:menutitem ). But what to do if the user use browser address line to type url directly? Edit: my.xhtml : <ui:define template="/mytemp.xhtml"> <f:event type="preRenderView" listener="#{mybean.init()}" /> <h:form> <p:commandButton update="@form" ... /> </h:form> </ui:define> If I do it that

JSF2 MyFaces and CDATA makes f:ajax render fail

戏子无情 提交于 2021-02-05 11:29:06
问题 I'm facing some problems using CDATA blocks inside h:outputscripts with MyFaces 2.0... but I don't know exactly if I should avoid using CDATA with JSF2 or if it is because I do things wrong. Maybe it is because I use many scripts in many Composite components... The fact is that when I have some composite components that contain scripts with surrounded by CDATA blocks, other scripts in the page doen't work. Removing CDATAs solves the issue. Nevertheless I've had an issue where using CDATA

How to populate inputText from selectOneMenu item?

纵饮孤独 提交于 2021-02-05 07:46:17
问题 So far I've not been able to hit on the right way to do it. I've got an inputText bound to a variable in an object. I've got a selectOneMenu item dropdown all full of goodness. The thought was that when selected, I'd just push the selected text from the dropdown into the input box (simulating typing it). Apparently that's a no go. I can grab the text of the selected element in a javascript onselect handler easily enough, but the inputText refuses to accept it (presumably choosing to redisplay

Email validation- characters length before @ and before dot

六眼飞鱼酱① 提交于 2021-02-04 07:53:07
问题 I use the following regex pattern for validating the email address that works fine, BUT I need to validate the length of characters before @ , which should NOT be less than 4 characters. The same rule I should put for the length of characters after @ and before dot . . For example, this email address is NOT valid: a@b.c However, this one should be valid: abcd@abcd.com How can I do it? Here is my current attempt: <ui:define name="validation-tag"> <f:validateRegex pattern="([\w\.-]*[a-zA-Z0-9_]

What is the difference between put and add method in statehelper in JSF 2

假如想象 提交于 2021-01-28 22:04:27
问题 What is the difference between: Object put(Serializable key, Object value) void add(Serializable key, Object value) methods in StateHelper in JSF? 回答1: I found the api documentation not that helpful myself and investigated it. Each time add is called it appends another value to a list which is saved under the given key. If you call a get on that key you get back a list. The add method saves you creating that list and watches for corner cases, ex. creating the list when the key is empty. The

No redirection after button click

戏子无情 提交于 2021-01-28 22:03:25
问题 I am new to jsf and trying to build app. Problem is when i click Login commandButton nothing happens. So i input some print lines and it show's me that connection with database exist and arguments are valid but it wont redirect. Here is index.xhtml <?xml version='1.0' encoding='UTF-8' ?> <!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://xmlns.jcp.org/jsf/html"