This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

using convertor in jsf

 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a h:inputText in my JSP. I have associated the value of this component with a backing bean property of type Double.

If input contains letters then I need to call a method in the backing bean and set the appropriate rendering flag and display the message.

But the action method is not called if a letter is entered, I guess this is because of the life cycle where conversion - validation - action takes place.

Hence it fails in the conversion phase. How can I call a backing bean method during conversion phase?

Regards,
Joshua
 
Saloon Keeper
Posts: 24531
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you're missing the point. It sounds like you're simply trying to do what the validator does anyway.

What you probably should be doing is simply using the standard validator, or customize it if it doesn't do what you want.
 
Joshua Antony
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

I tried to use a validator like:


But the problem I faced was that:

1. Validate method was getting called only if numeric value is enterd in the text field(corr backing bean property is of type Double)

2. Validate method not getting called if any string is entered

I need the validate method to be called irrespective of what is entered, so that I can do validation in that method and display appropriate message using FacesMessage.

Hopefully I am bit clear now.

Regards,
Joshua
 
Joshua Antony
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess, I need to use custom convertor, any other suggestion is welcome.

Regards,
Joshua
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic