facelets

How to customize JSF validation error message

依然范特西╮ 提交于 2019-12-28 03:05:13
问题 How can I customize the validation message that appears when validation fails? Here is the code I have: <h:form> <p><h:inputText id="userNo" title="Type a number from 0 to 10:"> <f:validateLongRange minimum="3" maximum="6"/> </h:inputText> <h:commandButton id="submit" value="Submit" action="response"/> </p> <h:message showSummary="true" showDetail="false" id="errors1" for="userNo"/> </h:form> Currently the message looks like this: j_idt10:userNo: Validation Error: Specified attribute is not

How to create dynamic JSF form fields

…衆ロ難τιáo~ 提交于 2019-12-27 08:18:29
问题 I have found some similar questions like this one, however there are so many ways this can be done that it made me more confused. We are getting an XML file that we are reading. This XML contains information on some form fields that needs to be presented. So I created this custom DynamicField.java that has all the information we need: public class DynamicField { private String label; // label of the field private String fieldKey; // some key to identify the field private String fieldValue; //

dynamic view injection or routing

岁酱吖の 提交于 2019-12-26 03:09:06
问题 i have a JSF projekt and in there i have different views, which are backed by ManagedBeans. What i would like to achieve is to change some views while others stay where they are. this has to happen dynamically. In other words. I want to inject and remove views from an xhtml page without a page refresh. I have no clue how to achieve this. Even better would be a dynamic view injection based on urls. angularjs does that very well. But even without routing it would be great. Thanks in advance.

use case for FacesConverter

纵然是瞬间 提交于 2019-12-25 18:33:29
问题 Referencing a previous question of mine, why is the @PostConstruct method not runnable? glassfish gives: INFO: MessageBean.. INFO: MessageBean.getModel.. INFO: SingletonNNTP.getMessages.. INFO: MessageBean.getModel.. INFO: SingletonNNTP.getMessages.. INFO: SingletonNNTP.setIndex..2,205 INFO: SingletonNNTP.setIndex..2,205 INFO: SingletonNNTP.setIndex..2,206 INFO: SingletonNNTP.setIndex..2,206 INFO: SingletonNNTP.setIndex..2,207 INFO: SingletonNNTP.setIndex..2,207 INFO: SingletonNNTP.setIndex.

parameter with <f:viewParam> and FacesConverter from CDI

ε祈祈猫儿з 提交于 2019-12-25 11:50:24
问题 It's not clear to me why I'm getting this particular exception, it's a red-herring I think. The underlying problem could be related to the last line of the exception: MessageConverter.getAsObject..0 which should actually be 1501 (the Message ID). So, why does MessageConverter.getAsObject have the wrong id? I think that this could be related to the Detail constructor, which is probably passing the wrong parameters to MessageConvert.getAsObject(), in particular the UIComponent object --

Passing argument to actionListener method with p:commandLink inside c:forEach loop

喜你入骨 提交于 2019-12-25 08:33:04
问题 I have a dialog that contains a list of graphic images inside command links. When a command link is clicked, I want to pass the image name as action listener method argument. Dialog's code: <p:dialog id="idSchemaDlg5" widgetVar="schemaDlg" styleClass="maxSizeDialog" position="90,250" style="max-width:1000px;max-height: 1000px;" header="Schéma des circuits"> <c:forEach id="schemaDataGrid" items="#{historyGenerationBean.schemaList}" var="fileCircuits" varStatus="schemaNum"> <h:panelGrid columns

ELResolver cannot handle a null base Object - Weblogic 10.3.x, Facelets 1.1.14, RichFaces 3.3.2

岁酱吖の 提交于 2019-12-25 04:47:04
问题 I'm having trouble using RichFaces 3.3.2 and Facelets 1.1.14 under Weblogic 10.3.4 and 10.3.5 (aka 11g). I have an xhtml file with the expression #{empty messages} , and on the console I get the following exception: SEVERE: Error Rendering View[/index.xhtml] javax.el.ELException: //media/DADOS/data/java/wl1034/user_projects/domains/wlrep1034/autodeploy/SimpleJSFa/index.xhtml: ELResolver cannot handle a null base Object with identifier 'messages' at com.sun.facelets.compiler.TextInstruction

Change the properties of an Input within a ui:repeat

断了今生、忘了曾经 提交于 2019-12-25 03:42:11
问题 I'd like to change the "required" property of an InputText that is located within an ui:repeat, but I'm not able to access to the component from the ManagedBean: <h:selectManyCheckbox id="required" value="#{test.required}" layout="lineDirection" converter="javax.faces.Integer"> <f:ajax event="change" listener="#{test.update}" /> <f:selectItems value="#{test.selectable}"></f:selectItems> </h:selectManyCheckbox> <ui:repeat value="#{test.names}" var="name" id="repeat"> <h:panelGrid columns="3">

Retrieve client id for facelets

纵然是瞬间 提交于 2019-12-25 01:35:53
问题 How do I retrieve clientId for a facelet included with ui:include? For a reusable component I use this syntax: cc.clientId . EDIT1 The question is in the context of Determine absolute id. To include the dynamic editors I use a custom include. The source code of DynamicInclude, DynamicIncludeComponent and DynamicIncludeHandler can be found at: http://pastebin.com/5e2dgR15. I had to remove the lines that tested the src for null in getSrc method of DynamicInclude and changed getFamily to return

Backing Bean not getting values sent by javascript

不打扰是莪最后的温柔 提交于 2019-12-24 16:13:10
问题 I have three drop down lists whose values are been copied to <h:inputHidden> components by the following JavaScript function: function getBirthDate() { var months = document.getElementById("months") var hidden1 = document.getElementById("formsignup:monthField"); hidden1.value = months.options[months.selectedIndex].text; var days = document.getElementById("days"); var hidden2 = document.getElementById("formsignup:dayField"); hidden2.value = days.options[days.selectedIndex].value; var years =