Thanks for your help. You are right, there should be a calculate button, but the stakeholders don't want another button on the web page.
But I figured out a dirty way to handle this. I'm using a hidden field to distinguish between display and calculate. Vikas -----Original Message----- From: Tamas Szabo [mailto:[EMAIL PROTECTED] Sent: Friday, May 05, 2006 2:14 AM To: Struts Users Mailing List Subject: Re: FormBean issue Hi! 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. Why does your code get executed in both cases? Execute it only when the user hits the display button (ie on display you populate the data from the DB). If the user wants to put in another value and calculate that he should hit a calculate button, resulting in execution of another action. Hope it helps, Tamas --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]