Doing more with h:messages/
I want to do more with my <h:messages/> I need some help because i'm not comming up with anything real creative here..
Here is the example;
<h:messages layout="table"/>
<h:form id="register">
<div id="wrapper" class="clearfix" >
<div id="maincol" >
<h:panelGrid columns="2">
<h:outputLabel value="Username"/>
<h:inputText required="true" id="username" value="#{regHandler.username}"/>
<h:outputLabel value="Password"/>
<h:inputSecret required="true" id="password" value="#{regHandler.password}"/>
<h:outputLabel value="Confirm Password"/>
<h:inputSecret required="true" id="confPassword" value="#{regHandler.confirmPassword}"/>
<h:outputLabel value="First Name"/>
<h:inputText required="true" id="first" value="#{regHandler.firstName}"/>
<h:outputLabel value="Last Name"/>
<h:inputText required="true" id="last" value="#{regHandler.lastName}"/>
<h:outputLabel value="E-mail"/>
<h:inputText required="true" id="email" value="#{regHandler.email}"/>
<h:graphicImage value="WeakAuth"/>
<h:inputText required="true" id="captcha" value="#{regHandler.weakAuthinator}"/>
</h:panelGrid>
<h:commandButton value="Register" action="#{regHandler.doRegister}"/>
</div>
</div>
</h:form>Now here is the problem, If I submit this form with out filling out any of the inputs I will get a nice table of
Validation Error: Value is required.
Validation Error: Value is required.
Validation Error: Value is required.
Validation Error: Value is required.
Validation Error: Value is required.
Validation Error: Value is required.
Validation Error: Value is required.In addition to these errors I would also like to highlight the input(s) that failed validation. Does anyone know how I can approach this?
Thanks in advance,
t
It works rather well.
I opted to use the form of an inline custom validators. Here is the important code in case anyone else ever needs it. I could have just as easy made a custom validator class and used the non-inline form of validation, but I opted for this methodology because it was the easiest to implement. (Yeah I know lazy)
For inline custom validators:
Register your custom validator bean in your faces-config.xml
<managed-bean>
<managed-bean-name>validator</managed-bean-name>
<managed-bean-class>com.serviceposter.handlers.ValidatorHandler</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>Next create your validation method:
public void validateEmail(FacesContext context,
UIComponent toValidate,
Object value) {
String email = (String) value;
if (email.indexOf('@') == -1) {
((UIInput)toValidate).setValid(false);
toValidate.getAttributes().put("styleClass","errorStyle");
FacesMessage message = new FacesMessage("Invalid Email address");
context.addMessage(toValidate.getClientId(context), message);
}Now bind your new method to the input:
<h:inputText required="true" validator="#{validator.validateEmail}" id="email" value="#{regHandler.email}"/>Finally create a css style to reflect the highlighting you want to use on the erroring component.
input.errorStyle {
background-color: red;
}
Similar Messages
-
After soak test update, I get error messages repeatedly. The majority are "unfortunately, messaging has stopped", but you can replace messaging with "android os", or any other process, as it happens with more than just messaging. I have had numerous people call and ask why I didn't reply to their texts...and I look, but have not received any new texts. YES, I have restarted phone. I have cleared data as well as cache on all apps. I have downloaded the vzw messaging app, which seems silly, since it happens with several different processes and apps, but all to no avail. I am missing texts from my employer, from my family. This did happen, but rarely, before this "soak test". It is now Kitkat version 19.6.3.obake_verizon.en.US. THIS is when I started having problems...like 50 times a day kind of problems! I have seen hundreds of posts all over the internet over the past 3 days. Does no one know how to fix this??? Shouldn't there be a way to revert phone to a pre-update state? and no, hard reset did NOT work!!!! I have been with verizon for well over 15 years, but I have not upgraded my lines and will not in July either. This is ridiculous. It's not like my games aren't working, it is my messaging and "android os"...my lifeline at work!
kristinaf333,
Oh no, I am sorry to hear your messages are not working since the software update. I greatlly appreciate doing all that troubleshooting to try and get the messaging application back in business. I know how much I rely on my messages so I can understand the urgency to get this resolved. Have you had a resolution ticket opened since you started experiencing issues with your messages? Does this happen with all contacts or just some? Please provide additional information to ensure we get to the bottom of this for you.
KarenC_VZW
Follow us on Twitter @VZWSupport -
My Macbook Pro won't print with my HP Photosmart 7515. I get the following message, " Print file was not accepted" Printer does work with our PC?? Checked for software updates and are none. Talked with HP help and they say it's an Apple problem
I noticed that you said you uninstalled the printer, but you didn't mention resetting the print system. Resetting the print system will reset the drivers the Mac has installed and make them work like they should. Give this a try and see if it gets the printer working like it should. The document below will expalin more about doing this.
Basic Printer Troubleshooting Steps for Mac
If that doesn't help, see if you are using the AirPrint driver, or the printers driver. By default 10.8 uses the AirPrint driver if the printer supports it, so I'm betting that's the driver you're using. If it is, try using the driver for the printer itself. To do this, access Print and Scan. Click the + sign to add a new printer. Select the printer from the list. Click the dropdown next to Use and select the 7515's driver. Let me know what happens.
I am a printer tech for HP. -
Hi, I forgot the password of my iphone4s I tried more than ten times and it lock me out with a message to connect the iPhone with itunes on the screen but the itunes doesn't recognise it. What can I do?
Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device
1. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
2. iOS- Forgotten passcode or device disabled after entering wrong passcode
3. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
4. iOS- Understanding passcodes
5. What to Do If You've Forgotten Your iPhone's Passcode
6. How to Recover Forgotten iPhone Restrictions Passcode | The iPhone and iPad
7. Restoring iPod touch after forgotten passcode
8. RecBoot: Easy Way to Put iPhone into Recovery Mode - if all else fails.
Forgotten Restrictions Passcode Help
1. How to Recover Forgotten iPhone, iPad Restrictions Passcode
If this method does not work, then you will need to fully Restore your
device as New
Also, see iTunes- Restoring iOS software. -
i am trying to download snow leopard, but with around 46 mins to go, a message appears saying, my coup is going to restart,it does but with just the apple logo,and white screen, nothing else,can anybody help? jib.
I think we need more clarification.
What do you mean by "download"? Only updates are available as downloads, the System software has to be installed from a DVD. -
I replaced my iPhone with a Samsung Galaxy5 and I am not receiving all of my text messages now. The rep at the store told me to go to iTunes and take my phone # off of the account and that would fix the problem. Is that true? What does iTunes have to do with text messages anyway?
You need to remove your phone number from the iMessage system.
Read here: http://support.apple.com/kb/ts5185
~Lyssa -
Just got new air and trying to set up. When I put in my Apple ID and password it comes up with error message 'can't sign in because of server error. Try again signing on.' Trying again does not fix. I know my ID and PW are right as work on other apple devices I have.
Using FaceTime http://support.apple.com/kb/ht4319
Troubleshooting FaceTime http://support.apple.com/kb/TS3367
The Complete Guide to FaceTime: Set-up, Use, and Troubleshooting Problems
http://tinyurl.com/32drz3d
Cheers, Tom -
My iPod doesn't sync it keeps coming up with the message "The iPod 'iPod Nano' cannot be synced. An unknown error occurred (13019)." What does this mean and how can I fix it?
I am getting the same error message. Have you figured it out?
-
since i have updated my iphone everytime i open an app it comes up with a message 'connect to itunes to use push notifications, may include alerts, sounds and icon badges, i have backed up my phone on itunes and restored phone but its still doing it can anyone help?
EmReturn the iPhone and get your money back. It has been
hacked/modified/jailbroken and likely cannot be made
operative. -
Does iCloud save voicemail messages from my iphone 5 when I back up? More specifically, I am trying to access messages from my now deceased father that were in my deleted voicemail folder at the time I last saved, that have since been cleared.
The iCloud backup includes visual voicemail messages. I'm not sure if it includes the deleted ones or not, but I would assume it does.
-
Ever since upgrading to Mountain Lion, my AOL messages sometimes, but not always open with a blank page. If I open AOL in Firefox, the messages open fine. This does not happen with any messages by any means, and it is not any type of certain message. In fact, in the same screen I can often open an email from the same sender with email intact. This is weird. Sometimes I close the page and open a new page. Sometimes that works and sometimes it does not. It is a very annoying thing.
Hi,
When you start Messages fro the first time you are asked for an Apple ID
When this is verified and entered it appears in Messages Menu > Preference > Accounts and is Enabled.
The App should have also picked on on those iChat Accounst you had before.
These should be Enabled if they were when you last used iChat.
Exactly which "Accounts" are logged in can be seen in Message Menu > Accounts and will include the iMessage "Account" and Bonjour.
In the Window menu you will see CMD +0 for the Messages window and CMD+1 for the "Buddies" window which is a combined list at this stage.
Go to the Preferences > General Section and Untick the "Collect all accounts into one list".
This will give you separate iChat type Buddy lists.
You can check if that account/Buddy list is set to Invisible or if in the Preferences > Accounts > Security you have settings that will block some people from seeing you as On line.
You are saying Buddies can see you as On Line which implies they are still sending to your AIM based Names (@Mac.com is a valid AIM Screen Name)
I am not sure from your post if you are trying to iMessage their email IDs thinking they are Apple IDs and that they are using Messages as well.
There is no Buddy list for iMessages side
No-one can tell you are "On Line" until they have your details in the "To" spot in Messages with the correct iMessaged contact info (iPhone Number or Apple ID)
Obviously an Apple ID can be an email or look like one.
In some cases they are also valid AIM Screen Names as well.
In the case or the @mac.com name you may have linked this Apple ID to iMessages as well.
11:31 PM Saturday; August 11, 2012
Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
"Limit the Logs to the Bits above Binary Images." No, Seriously -
Does anybody know why my ipod touch 3rd generations screen does not show anything? The screen is all black constantly. When I try to synchronise my ipod with my iTunes library it comes up with a message saying " iTunes could not back up the ipod because a session could not be started with the ipod. Please help and reply if you know an answer!!!
Try this previous discusssion:
https://discussions.apple.com/message/12518406#12518406 -
I have an ipad (IOS 7.1) and downloaded latest version of itunes (11.1.5.5) and downloaded itools (1.8.2.8) but my Itools does not work and message that your itools is not compatible with itunes so please want your comment for that.
Hello JD_NINJA,
Thanks for using Apple Support Communities.
Error 9006 when restoring your iOS device indicates that there is security software on your computer which is preventing connection to the Apple server or your device. To troubleshoot this issue please follow the directions below.
Check your security software
Related errors: 2, 4, 6, 9, 1611, 9006. Sometimes security software can stop your device from communicating with either the Apple update server or with your device.
Check your security software and settings to make sure that they aren't blocking a connection to the Apple servers.
Get help with iOS update and restore errors - Apple Support
When restoring your iPhone, please make sure to follow the directions in the link below to properly restore.
Restore your device from an iCloud or iTunes backup - Apple Support
Take care,
Alex H. -
How does one show full message headers in Mail 8.1?
he previous 'complete header' option has been replaced with a time consuming 'custom' choice.Customize your toolbar in Mail and add the All Headers button:
-
Caller ID - does it work with text messages?
hi there , I set up callerID.
tried to call a number in malaysia, the callerID doesn't show up. perhaps it varies from country to country
however, what I really want to know is, does caller ID work with text messages? I send SMS Thru skype, and the receiver will see the caller ID ?I unfortunately have not found anything out. I also have since purchased a 2011 Nissan Murano and still have the Rogue. From time to time in the Rogue the caller ID works, but it paired ok after several tries with my Murano and the caller ID seems to work, but I dont drive that vehicle daily its my husbands. I wish Apple would do something to fix this bluetooth issue everyone else I know with a Nissan and bluetooth does not have this issue its totally something to with Apple. My Murano does not have Nav its only an SL. Good luck!
Maybe you are looking for
-
Why do I have 2 icons for WD Mybook Edition II?
I have two icons on my desktop title line (don't know if this is correct name for the top horizontal bar) for my WD Mybook Edition II backup. I had a problem with the WD a few months ago and I somehow got it fixed but am unsure how that happened. N
-
The project could not be prepared for publishing because an error occurred. (-50)
-
Passing date to xcelius dashboard using openDocument.jsp
Hi. I created a xcelsius dashboard that uses WEBI report through live-office connection. this dahsboard was uploaded to BO server (InfoView), and I am using openDocument.jsp to view it. ht ejsp gets parameters that I use to set prompts. Well, for num
-
Problem transferring tracks from my PC to my Zen To
Rather than going through the rigmarole of contacting customer support I was wondering if anyone here can help me? I've just purchased the 20GB Zen Touch & I have about 2000 songs I want to put on it. The problem is that it only seems to transfer 0-5
-
Thumbnails but "!" for pics
Oh help. I can see my thumbnails but when I click on my pictures to edit or print it comes up with a gray screen and a dotted line with an "!" instead of the picture. I have read below that this has happened to others so I followed previous advice an