on 10-05-2005 3:18 PM
Hi All,
I have a dropdown byIndex which is being populated by calling a bapi.
I set that cardinality to 0..n
So I am getting blank row in that DD.
I dont want to change the cardinality to 1..1
But If the user selects the blank row in dropdown,on click of one button I want to show the error message saying that "Plz fill all Madatory fields".
But on action I am getting the Value of the attribute which is bind with the drop down.But that is giving null pointer exception. Tell me the proper way to do this..
Thankx and Regards,
Karthick
Hello,
the problem seems to be that you have no "currentElement" in your context. You should check whether the currentElement return null. In general its bad practice to catch an exception instead of check for null values where you expect one. To throw and catch an exception is a hundred times more costly then a simple if-check.
Also have a look at:
http://help.sap.com/saphelp_erp2004/helpdata/en/95/93fe1e71a2e44691b1f041e67f71aa/content.htm
Frank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi karthick,
do one thing.if user selects blank row.it will raise nullpoiner exception.catch that null pointer exception.
display error message.
like
try{
//ur coode
}catch(NullPointerException e)
{
wdComponentAPI.getMessageManager().reportException("select any value",true);
}
hope this will work
regards
Naidu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karthick,
Inside the action handler, just write:
if(null==wdContext.current<node>Element.get<DD_Attribute>())
{
wdComponentAPI.getmessageManager().reportWarning("Plz fill all Madatory fields");
return;
}
Hope this helps,
Best Regards,
Nibu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.