Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

a4j:support inputtext  RSS feed

 
Shailesh Paranjpe
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi
I have the above code and want to achieve functionality wherein

1. the amount that is entered in the field will get converted to a double when the focus is lost on the field.
the use case calls for allowing mnemonics m/M for million etc. So 10M will get converted to 10000000 and so on.

2. I want to reuse this behaviour across multiple applications and would like to package it as such.

I have read different blogs pertaining to this. In some ways, I can solve this by having an actionHandler in testBean that will convert. However, that approach will not work. For example, when reused, the value will not point to testBean.amount but some beanX.price. The converter routine has to be the one that does this.

Can anyone share some ideas/experience that may help me in finding a solution to this problem?

Regards
--
Shailesh

PS> Seam w/Richfaces is the environment I am working in.
 
Max Katz
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) a4j:support fires an Ajax request from the input field, it doesn't convert or format the value. Use converter/validator to do that.

2) Create a Facelet custom tag is one option

Max
http://mkblog.exadel.com
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!