1) actually i have entered the value as 101 in rebate field and tabout then error displayed as invalid value immedeately rebate field has cleared.
2) then i clicked the save button it is saving the records with null as rebate field in DB.
That is expected, isnt it? If you do not want NULL to be saved for Rebate field, have that validation too in setRebate() method.
Note that, this NULL validation exception will be invoked every time the data is posted to the DB.
If you want this exception to be thrown only while clicking on 'Apply' button, you need to capture the 'Apply' button event and incorporate it there before doing the Commit.
But the code you are using only works for the limitation on REBATE you have defined . Means it should be between 0 to 100.
And code is doing well to restrict you entering negative or 100+ values for rebate.
To deny commit if you are not entering any value for the "Rebate " field , You have to check:
**** Whether rebate column in your table has been defined a constraint "NOT NULL" ????*
You can use either of the below ways to stop committing your data if "Rebate " field is null :
1. Define a NOT NULL contraint for Rebate column in table , then it will be handled by EO itself . And it will throw you an exception once you try to save.
2. Or make this field REQUIRED in OAF page, and it will be taken care by OAF and it will not allow to proceed if you are not entering value in Rebate field.