tag:blogger.com,1999:blog-5396570633771229267.post5405808661218954490..comments2024-03-29T00:04:12.306+01:00Comments on The BalusC Code: Validator for multiple fieldsBalusChttp://www.blogger.com/profile/00299057045960008647noreply@blogger.comBlogger51125tag:blogger.com,1999:blog-5396570633771229267.post-18347152760572851952016-05-20T17:22:56.676+02:002016-05-20T17:22:56.676+02:00This is a great article. I was going nuts as I nee...This is a great article. I was going nuts as I needed to validate a lot of date fields in relation to one another. Some can only be entered if others are present, and some have to be "after" others etc. <br /><br />This solution works really well.<br /><br />My only issue was that the field I "attached" the validation to was getting red-highlighted even if it was valid. So nowHeatherhttps://www.blogger.com/profile/16302166649151114202noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-14470034606237380252016-04-21T07:49:54.313+02:002016-04-21T07:49:54.313+02:00reposting due to missing statement......
Hi,
Tha...reposting due to missing statement......<br /><br />Hi,<br /><br />Thanks for the code!! its very helpful.<br /><br />I am trying to use TAG - "inputText" instead of "inputsecret" tag in jspx page , but the PasswordValidator is failing as its not able to Type Cast RichInputText to UIInput "oracle.adf.view.rich.component.rich.input.RichInputText cannot be cast to allyahttps://www.blogger.com/profile/06312134478084078950noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-69418430014316499232016-04-21T07:48:03.600+02:002016-04-21T07:48:03.600+02:00Hi,
Thanks for the code!! its very helpful.
I am...Hi,<br /><br />Thanks for the code!! its very helpful.<br /><br />I am trying to use instead of , but the PasswordValidator is failing as its not able to Type Cast RichInputText to UIInput "oracle.adf.view.rich.component.rich.input.RichInputText cannot be cast to javax.faces.component.UIInput<br />".<br />How do I reslove this.allyahttps://www.blogger.com/profile/06312134478084078950noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-9379434441616028612015-10-15T12:59:31.121+02:002015-10-15T12:59:31.121+02:00Hi,
Can we disable an input text from this bean ...Hi,<br /><br /><br />Can we disable an input text from this bean class?Anonymoushttps://www.blogger.com/profile/06683064481725081775noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-1750974653209576182014-09-15T16:51:53.968+02:002014-09-15T16:51:53.968+02:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/13192484177020173309noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-57568519150360522622014-09-15T16:47:33.388+02:002014-09-15T16:47:33.388+02:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/13192484177020173309noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-84186504748298985512013-09-06T13:09:40.737+02:002013-09-06T13:09:40.737+02:00can we provide multiple validator message for a si...can we provide multiple validator message for a single component. OR can we print p:message from bean class using FacesMessage??Anonymoushttps://www.blogger.com/profile/12377522561346122942noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-31876329613578262322012-04-12T02:39:20.624+02:002012-04-12T02:39:20.624+02:00How to validate strictly only checkbox to be selec...How to validate strictly only checkbox to be selected among many checkboxes in jsfIshaanhttps://www.blogger.com/profile/16332656610518558433noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-17784667094403485702011-12-12T17:33:26.087+01:002011-12-12T17:33:26.087+01:00Another observation: if one of the injected inputs...Another observation: if one of the injected inputs is optional and gets converted to a non-string type (date, number etc.) then a null won't get injected into the f:attribute because it hasn't propagated to the component.value yet. You can use component.localValue instead as a workaround. <br /><br />See:<br />http://java.net/jira/browse/JAVASERVERFACES-2264Anonymoushttps://www.blogger.com/profile/10473101381793442268noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-83658997202740696942011-11-21T16:17:10.342+01:002011-11-21T16:17:10.342+01:00Thanks! I like this approach because you don'...Thanks! I like this approach because you don't have to reference component ID's in the managed bean.<br /><br />Two important clarifications of note:<br /><br />1. #{component.value} references the UIInput's getValue() method, not a managed bean property. (In the Process Validations phase, setters haven't been called yet, and may not get called.)<br /><br />2. It's Anonymoushttps://www.blogger.com/profile/10473101381793442268noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-34488574570669830522011-07-22T12:37:22.360+02:002011-07-22T12:37:22.360+02:00This helped me when I was just about to give up on...This helped me when I was just about to give up on JSF validation and switch to Javascript validation instead! Cheers!~nikhilopedia~https://www.blogger.com/profile/08307548357924089116noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-37171176514560544352011-05-17T13:31:21.496+02:002011-05-17T13:31:21.496+02:00simple and easy to understand...thx so much BalusC...simple and easy to understand...thx so much BalusC.Tommy Maurice Kacaribuhttps://www.blogger.com/profile/10440781385798995396noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-43944619126101420092011-04-15T08:42:12.009+02:002011-04-15T08:42:12.009+02:00Thank you ! Its working for me & solve lots of...Thank you ! Its working for me & solve lots of big issue............Sonalhttps://www.blogger.com/profile/03652775500086547545noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-69455913512847379052011-01-29T14:47:36.868+01:002011-01-29T14:47:36.868+01:00Hi Balusc,
how to set the condition the text f...Hi Balusc,<br /> how to set the condition the text field want to allow only integer. also the text field should allow greater than integer 20.<br /> plz send the code for that.thanksAnonymoushttps://www.blogger.com/profile/00054218721084607739noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-71673574730724832492010-06-25T13:24:07.894+02:002010-06-25T13:24:07.894+02:00I am writing an application with seam 2.2 facelets...I am writing an application with seam 2.2 facelets and richfaces.<br />I tried your solution but it didn't work for me because of a tricky reason :<br />in my xhtml file i DO declare an id for my inputText :<br />h:inputText id="clientName" value="#{clientManager.clientName}"<br /><br />but in the generated HTML i do not find the id attribute !!!<br />It looks like : inputLazreghttps://www.blogger.com/profile/16665536628127712943noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-31266598461150255392010-06-12T12:58:49.322+02:002010-06-12T12:58:49.322+02:00Great dude your code is working excellent with ice...Great dude your code is working excellent with icefaces...Chetanhttps://www.blogger.com/profile/16250523852365659953noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-18256439700817825792010-06-11T07:44:23.401+02:002010-06-11T07:44:23.401+02:00Hi BalusC,
Thank you for the Code. But, I have a ...Hi BalusC,<br /><br />Thank you for the Code. But, I have a question.<br />I want during checking the error will be shown not only on confirm field, but also on password field and if I change password value in such a way that it will equal to confirm value, both errors will disappear. <br />Can you give me an advice how can I do that or may be some link?Aramhttps://www.blogger.com/profile/01144658003395901412noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-52069149682199220422010-05-21T22:09:13.982+02:002010-05-21T22:09:13.982+02:00Oh, it seems I cannot paste my code :-(
Anyway, m...Oh, it seems I cannot paste my code :-(<br /><br />Anyway, my code is exactly like yours, but in the server side it doesn´t retrieve the value of the attribute but it literally retrieves "register:password".<br /><br />Thanks once more!graciaschemihttps://www.blogger.com/profile/07997584737979105979noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-68458943455946669232010-05-21T22:06:49.995+02:002010-05-21T22:06:49.995+02:00Yes, I´ve done it.
My code is like this
...Yes, I´ve done it.<br />My code is like this<br /> <br /><br /> <br /><br /><br /> <br /><br />and my form name is "registerform" <br />Thanks againgraciaschemihttps://www.blogger.com/profile/07997584737979105979noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-34202151358984587802010-05-21T20:54:22.133+02:002010-05-21T20:54:22.133+02:00You need to change the f:attribute accordingly. Ch...You need to change the f:attribute accordingly. Check in the generated HTML output what the final client ID of the password element is and specify that in the f:attribute.BalusChttps://www.blogger.com/profile/00299057045960008647noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-3179511676719522812010-05-21T20:51:24.070+02:002010-05-21T20:51:24.070+02:00Your code is very nice, but it´s not working for m...Your code is very nice, but it´s not working for me :-(<br />When I do:<br />String passwordId = (String) component.getAttributes().get("passwordId");<br />I literally get passwordId="registerform:password" (in the Validator).<br />How can I get the real value, and avoid getting the string with registerform:password?<br /><br />Thanks a lot for your help!!<br />Sergiograciaschemihttps://www.blogger.com/profile/07997584737979105979noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-40294897936694284492010-02-11T12:11:26.023+01:002010-02-11T12:11:26.023+01:00Let the required attribute evaluate 'true'...Let the required attribute evaluate 'true' if none of the other two fields is submitted.BalusChttps://www.blogger.com/profile/00299057045960008647noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-23773423688196365422010-02-10T23:40:41.286+01:002010-02-10T23:40:41.286+01:00Tks for the example. But I need validate whatever ...Tks for the example. But I need validate whatever one of some fields. Its required that the user type one of them. How do i can do this?gersonlchttps://www.blogger.com/profile/06978453011282240169noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-30571442557254192102010-02-04T13:39:36.238+01:002010-02-04T13:39:36.238+01:00Hi BalusC! I came across a following problem. Your...Hi BalusC! I came across a following problem. Your validation works perfect unless you attach a rich:message to the component that should be passed with f:attribute. The error only happens when I wrap rich:message with my own Facelet component (to add some custom look and feel) and put it in a separate JAR like here:<br /><br />http://thomaswabner.wordpress.com/2008/06/25/Pawel Dudahttps://www.blogger.com/profile/03376986884496350112noreply@blogger.comtag:blogger.com,1999:blog-5396570633771229267.post-30405327692656073512009-09-15T12:02:34.065+02:002009-09-15T12:02:34.065+02:00You didn't seem to answer the comparison of 2 ...You didn't seem to answer the comparison of 2 values in a datatable.<br /><br />As the fields are handled "in order" - I store the fields and on the validator of the last field in the row I do the actual comparison<br /><br /><br />so here goes ...<br /><br /><b>JSP</b><br /><br />h:datatable value="{#mybean.anArray}" var="x"<br /> h:inputText validator="{#Unknownhttps://www.blogger.com/profile/10746225856316076234noreply@blogger.com