jsf-2

Validator with attributes for custom component

谁说胖子不能爱 提交于 2019-12-11 08:22:40
问题 I want to create validator for custom component where I want to pass few attributes. This is how code looks like (it's not original code but is implemented in the same way): Custom component (customComponent.xhtml) <h:body> <composite:interface componentType="compositeComponent"> <composite:attribute name="name" required="true" /> <composite:attribute name="value" required="true" /> <composite:attribute name="values" required="true" /> <composite:editableValueHolder name="validator" targets="

disable options in the List JSF 2

情到浓时终转凉″ 提交于 2019-12-11 08:21:26
问题 <h:selectManyListbox value="#{bean.selectedColor}"> <f:selectItems value="#{bean.colors}" var="u" itemLabel="#{u.code}" itemValue="#{u.description}" itemDisabled="true"/> </h:selectManyListbox> I set itemDisabled to true in f:selectItems but it is still enabled on the screen. Please let me know if I am missing anything. 回答1: This generates a HTML <option disabled="true"> element. The specified behaviour is that the item is unselectable, not that the item is hidden. You seem to be expecting

css file with version appending

久未见 提交于 2019-12-11 08:20:09
问题 I want to create a way to update references to css files in jsf in an automated way (through ant, etc.) what is the common practice for this? are there any automated tools available already? Basically I want to be able to deploy my war file and make sure that any changes the modified css files are downloaded by clients without them having to clear their cache. Thanks for the help! 回答1: You can make use of JSF builtin resource library versioning. You'll only need to introduce a resource

java.lang.IllegalStateException: Unable to load current conversations from the associated request,something went badly wrong when associate was called

纵饮孤独 提交于 2019-12-11 08:15:07
问题 I have the following dialog with a dataTable. The remove button works fine with few lines on the dataTable. <p:dialog id="dlgEditPrices" header="#{msg.contractPriceEditPrices}" widgetVar="EditPricesDialog" modal="true" resizable="false" closable="false"> <h:form id="frmEditPrices"> <h:panelGroup id="displayEditPrices" rendered="#{contractPriceBean.selected != null}"> <p:dataTable id="dataEditPrices" var="item" value="#{contractPriceBean.contractPriceOffers}" editable="true" paginator="false"

Java Applet seems to use old response object when given jsession id

我们两清 提交于 2019-12-11 08:14:55
问题 I have a file upload applet in my jsf page. This applet expects an adress where it can send it's POST request. (I can't edit this post request to add more fields or something). The post method of my servlet then stores the file. This job can't be done by a managed bean because the servlet has to be annotated with @MultiPartConfig and I can't add this annotation to the jsf managed bean. In order to force the upload applet to use the same session I added an URL attribute named jsessionId to the

Setting Managed Bean attribute's value from JSF page and using it in bean's methods

99封情书 提交于 2019-12-11 08:09:08
问题 I have a ViewScoped Managed Bean. In my .xhtml page I want to set bean's attribute's value and use it in methods in the same bean. I managed to set the value from jsf page, but when i want to use it in some method the value of an attribute is not the value i have set before. Description (xhtml): In this form there is a command link which sets the value of an attribute. And it is working fine. Also, as command link is clicked, second form is being showed. <h:form> <h:commandLink value="Set" >

object is null in the session attribute map when accessed from servlet filter

百般思念 提交于 2019-12-11 07:56:09
问题 I have a servlet filter to force user authentication. It checks for the existence of a non-null object in the HttpSession. For some reason that I cannot figure out, the session contains an object with the correct name, but HttpSession.getAttribute is returning as null. Here is the process that it goes through. from the login page, it calls an action which contains the following user validation code. At this point I am 100 percent sure the object "login" is not null. if (passWordIsValid) {

JSF, Spring, and the PreRenderViewEvent

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 07:48:37
问题 I'm trying to integrate Spring 3 into a JSF 2 project. I registered the SpringBeanFacesELResolver in the faces-config.xml and I added two listeners to the web.xml: <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> </listener> Most views and backing-beans are just working, but unfortunately, the javax.faces.event

Can we apply mask operation with <p:calendar>

不羁岁月 提交于 2019-12-11 07:43:23
问题 <h:column> <f:facet name="header"> <h:outputLabel value="#{label.asOfDate}" style="font-weight:bold" /> <h:outputLabel value="*" style="font-weight:bold; color:red; font-size:150%" /> </f:facet> <p:calendar id="date" required="true" navigator="true" mindate="#{utils.minDate}" pattern="#{label.dateFormat}" maxdate="#{utils.maxDate}" value="#{policy.asOfDt}" requiredMessage="#{label.asOfDateRequired}" showOn="button"> <f:validator validatorId="CustomDateValidator" /> </p:calendar> </h:column> I

The reasons to use binding in a JSF form

不打扰是莪最后的温柔 提交于 2019-12-11 07:39:57
问题 I am new to the JSF. Can anybody please explain me why binding attribute is used in the code below: <h:form id="epox" binding="#{rxManufacturerEditor.form}" /> I am a bit confused with value and binding attributes, however I am not getting why we mention binding attribute with form tag. 回答1: The only reason to use binding to a backing bean's UIComponent instance that I know of is the ability to manipulate that component programmatically within an action/actionlistener method, or ajax listener