• Post Reply Bookmark Topic Watch Topic
  • New Topic

Richfaces 2.2 Calendar input field and validation issue  RSS feed

 
Randy Maddocks
Ranch Hand
Posts: 148
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have come across an issue I can't seem to fix. I have a rich:calendar component on a form (in popup mode, so button appears beside calendar input field, and input feature enabled). If a user manually enters an invalid date and then either presses the Tab key or clicks out of the field validation works fine - it flags the date as invalid and produces an error message on the form. If the user then clicks the calendar button and clicks to select a date, which then appears in the calendar input field, but then immediately clicks out of the field the validation error message does not go away. However, if the user clicks the Calendar input field again and then clicks another field the validation error message goes away.

So it's like when clicking to select a date from the popup calendar, it then displays in the input field but the field isn't really "active" (i.e. does not have the cursor flashing in it). Pressing the Tab key works regardless, which would probably be due to the fact I am using the oninputblur event. I tried adding a second a:support tag with an onblur event, but that did not work. Below is the jsf code that applies to the component. If anyone has any ideas it would be greatly appreciated. I did not include the action bean, but can do so if it helps. Thank you.



Regards,

Randy Maddocks
 
Tim Holloway
Bartender
Posts: 18715
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing that isn't helping is that you've got really horrible bean names. "_p18CntlPrsn" starts with an underscore and Java convention on underscores is pretty much for internal system use only, not user code.

"P18SlipHome" also offends, since bean names should always begin with a lower-case letter. In fact, the default name for a bean is its simple class name with the first character down-shifted to lower-case.

Offences like these can annoy Java tools and services, causing unpredictable results.

As far as the focus stuff goes, assuming that bean naming isn't at fault, I'm not sure what the "a" tagset is, although it seems to be like what's conventionally labeled as "a4j". That tagset was almost extinct in RichFaces 3 and I'm not sure if it's used at all in RichFaces 4. RF4 would generally use the JSF ajax tags, instead.
 
Randy Maddocks
Ranch Hand
Posts: 148
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,

I concur on the bean names. At the risk of coming across as one of those "I didn't do the original code and I wouldn't make those kinds of mistakes" developers, I do admit some of the coding is not mine. Again, that still doesn't remove me totally from blame. But I digress...

Also, my apologies, the "a" is actually defined in the namespace for http://richfaces.org/a4j  - I should have indicated as such in my original email.

I will look into RF4 as you have referenced.

Many thanks for your quick reply!  
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!