why validation wont work?
-
Hi, i have successfully added validation for my textboxes. i have 2 buttons, the add and the delete. When the user click on the add button without any input to the textboxes, a message will display telling the user to input value, however when the delete button is clicked instead of the add button, the validation would appear and it wont allow me to delete. why is this so? Needing help!
modified on Tuesday, January 4, 2011 10:27 PM
-
Hi, i have successfully added validation for my textboxes. i have 2 buttons, the add and the delete. When the user click on the add button without any input to the textboxes, a message will display telling the user to input value, however when the delete button is clicked instead of the add button, the validation would appear and it wont allow me to delete. why is this so? Needing help!
modified on Tuesday, January 4, 2011 10:27 PM
pancakeleh wrote:
why is this so?
it is very difficult to predict why it is so. please mention you code
modified on Tuesday, January 4, 2011 11:16 PM
-
pancakeleh wrote:
why is this so?
it is very difficult to predict why it is so. please mention you code
modified on Tuesday, January 4, 2011 11:16 PM
my delete button code as follows:
public String button1_action() {
try{ RowKey rk = tableRowGroup1.getRowKey(); if(rk != null){ incidentdataDataProvider.removeRow(rk); incidentdataDataProvider.commitChanges(); incidentdataDataProvider.refresh(); } }catch(Exception ex){ log("ErrorDescription", ex); error(ex.getMessage()); } return null; }
my add button as follows:
public String add_btn_action(){
String myString = (String) getIncidentidtxt().getValue(); Integer incidentIDName = Integer.parseInt(myString); String incidentNameName = (String)getncidentnametxt().getValue();
getSessionBean1().updateIncident(incidentIDName, incidentNameName);
incidentdataDataProvider.refresh(); return null; }
-
Hi, i have successfully added validation for my textboxes. i have 2 buttons, the add and the delete. When the user click on the add button without any input to the textboxes, a message will display telling the user to input value, however when the delete button is clicked instead of the add button, the validation would appear and it wont allow me to delete. why is this so? Needing help!
modified on Tuesday, January 4, 2011 10:27 PM
before starting validation, check which button was pressed. should be somewhere available in a Event-object or you extract that information to some variable, which you can access when and where needed. a boolean value should do the trick. regards Torsten
I never finish anyth...
-
before starting validation, check which button was pressed. should be somewhere available in a Event-object or you extract that information to some variable, which you can access when and where needed. a boolean value should do the trick. regards Torsten
I never finish anyth...
thanks i manage to solve it ;)
-
thanks i manage to solve it ;)
please pancakeleh, how did u do it?show as the code please...thanks alot..