on 12-09-2008 10:04 AM
Hi Experts,
I'm Getting null pointer exception while setting some value to the the text box UI elemnt which is binded to model attribute. Suggest me in this.
Regards,
Suman
Hi Suman
Null pointer exception means that u have tried to access a parameter while it is still null.
If u post the code it will be easier to help u.
Nitsan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
public void wdDoInit()
{
//@@begin wdDoInit()
int month=0,year=0,day=0;
String month1,day1,year1;
IWDMessageManager manager = wdComponentAPI.getMessageManager();
IWDClientUser user = WDClientUser.getLoggedInClientUser();
String logUser = user.getSAPUser().getUniqueName();
// manager.reportSuccess(logUser);
wdContext.currentContextElement().setUserid(logUser);
wdThis.wdGetAPPController().executeBapi_Employee_Getdata_Input();
if(wdContext.nodeNominee().size()==0)
{
Calendar cal=Calendar.getInstance();
month=cal.get(Calendar.MONTH)+1;
if(month==1||month==2||month==3||month==4||month==5||month==6||month==7||month==8||month==9)
{
month1="0"+month;
}
else
{
month1=""+month;
}
manager.reportSuccess(month1);
day = cal.get(Calendar.DAY_OF_MONTH);
if(day==1||day==2||day==3||day==4||day==5||day==6||day==7||day==8||day==9)
{
day1= "0"+day;
}
else
{
day1=""+day;
}
year = cal.get(Calendar.YEAR);
year1=""+year;
String strFormat=day1"."month1"."year1;
manager.reportSuccess(strFormat);
wdContext.currentOutput_NomineeElement().setBegda(strFormat);
wdContext.currentOutput_NomineeElement().setEndda("31.12.2008");
wdThis.wdGetAPPController().executeZ_Hrfm_Nominee_Disp_Input();
Note:-Both Begda and Endda are string parameters in the backend
Edited by: sumankumar kurimilla on Dec 9, 2008 11:43 AM
I have changed the code as you said but still i'm facing the issue.
I'm passing the correct arguments to the model attributes. Also i Have tested the output for those attributes,which is proper .
int month=0,year=0,day=0;
String month1,day1,year1;
IWDMessageManager manager = wdComponentAPI.getMessageManager();
IWDClientUser user = WDClientUser.getLoggedInClientUser();
String logUser = user.getSAPUser().getUniqueName();
// manager.reportSuccess(logUser);
wdContext.currentContextElement().setUserid(logUser);
wdThis.wdGetAPPController().executeBapi_Employee_Getdata_Input();
if(wdContext.nodeNominee().isEmpty())
{
Calendar cal=Calendar.getInstance();
month=cal.get(Calendar.MONTH)+1;
if(month==1||month==2||month==3||month==4||month==5||month==6||month==7||month==8||month==9)
{
month1="0"+month;
}
else
{
month1=""+month;
}
manager.reportSuccess(month1);
day = cal.get(Calendar.DAY_OF_MONTH);
if(day==1||day==2||day==3||day==4||day==5||day==6||day==7||day==8||day==9)
{
day1= "0"+day;
}
else
{
day1=""+day;
}
year = cal.get(Calendar.YEAR);
year1=""+year;
String strFormat=day1"."month1"."year1;
manager.reportSuccess(strFormat);
wdContext.currentOutput_NomineeElement().setBegda(strFormat);
wdContext.currentOutput_NomineeElement().setEndda("31.12.2008");
Thanks alot for the support.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I guess your problem is in this condition:
wdContext.nodeNominee().size()==0
U can not ask for size when the parameter is null.
U should change the condition to something like :
wdContext.nodeNominee().isEmpty()
Hope it helps
Nitsan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
post the complete error trace ?
Regards,
ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.