Hi Everybody,
My form bean has a BigDecimal field called chargeFee with default value
of 0 (new BigDecimal(0)).
This field directly maps to an html text field on my web page. The web
page looks something like this
Client ID =
Credit Amount=
Charge Fee=
Final Credit Amount= (Credit Amount - Charge Fee)
On my webpage I have a display button and a submit button.
The first time the user enters the Client ID and hits display button on
the web page, I have to populate the chargeFee from a database.
So I do something like this.
if(formBean.getChargeFee().doubleValue()==0)
formBean.setChargeFee(someValueFromDatabase);
And the value from database is always greater than 0.
The user is allowed to change the chargeFee back to 0 and then I have to
use 0 to calculate the Final Credit Amount.
But my code (shown above), would get the value from database anytime the
chargeFee==0.
So how do I distinguish between the two cases?
1. When the chargeFee came as 0 because the default is 0 and the
user had not entered any value.
2. When the chargeFee came as 0 because the user had deliberately
made it 0.
Thanks in advance for any help.
Vikas