I have implemented a code for one form its name is hardware form and first i will enter data it will take it and after enetering the second time it is gving me an null pointer exception it is not allowing me to update this form please can any one help me out.
Regards,
rahul.
Code where it is giving error is (in editing):
public String add_action() {
RequestBean1 bean = getRequestBean1 ();
String name= this.getProject _id().getText() .toString();
CachedRowSetDat aProvider pro_allocDataPr ovider = bean.getProject _allocateDataPr ovider();
try {
if(pro_allocDat aProvider.getRo wCount()>0) {
pro_allocDataPr ovider.cursorFi rst();
do {
if (pro_allocDataP rovider.getValu e("project_allo cate.project_id ").toString().e quals(name)) {
System.out.prin tln(name);
pro_allocDataPr ovider.setValue ("project_alloc ate.project_id" , this.getProject _id().getText() );
pro_allocDataPr ovider.setValue ("project_alloc ate.project_nam e", this.getName(). getText().toStr ing() );
pro_allocDataPr ovider.setValue ("project_alloc ate.owner", this.getOwner() .getText().toSt ring() );
pro_allocDataPr ovider.setValue ("project_alloc ate.ISV", this.getISV_nam e().getText().t oString() );
pro_allocDataPr ovider.setValue ("project_alloc ate.start_date" , this.getStart_d ate().getText() );
pro_allocDataPr ovider.setValue ("project_alloc ate.end_date", this.getEnd_dat e().getText() );
pro_allocDataPr ovider.setValue ("project_alloc ate.ptype", this.getProject _type().getSele cted().toString () );
pro_allocDataPr ovider.setValue ("project_alloc ate.location", this.getLocatio n().getSelected ().toString() );
pro_allocDataPr ovider.setValue ("project_alloc ate.scope", this.getScope() .getText().toSt ring() );
pro_allocDataPr ovider.setValue ("project_alloc ate.isvvisit", this.getISV_vis it().getSelecte d().toString() );
pro_allocDataPr ovider.setValue ("project_alloc ate.network", this.getNetwork ().getSelected( ).toString() );
pro_allocDataPr ovider.setValue ("project_alloc ate.addition", this.getAdditio nal().getText() .toString() );
pro_allocDataPr ovider.setValue ("project_alloc ate.DBOS", this.getDbos(). getText().toStr ing() );
pro_allocDataPr ovider.setValue ("project_alloc ate.model", this.getModel() .getText().toSt ring() );
pro_allocDataPr ovider.setValue ("project_alloc ate.memory", this.getMemory( ).getText().toS tring() );
pro_allocDataPr ovider.setValue ("project_alloc ate.cpu", this.getCpu().g etText().toStri ng() );
//
pro_allocDataPr ovider.commitCh anges();
}
} while (pro_allocDataP rovider.cursorN ext());
}
info ("Hardware details updated successfully.") ;
return "case1";
} catch (Exception ex) {
log("Error Description", ex);
error("Error :"+ex.getMessag e());
}
return null;
}