cancel
Showing results for 
Search instead for 
Did you mean: 

Java null pointer exception

Former Member
0 Kudos

HI ,

i have a requirement like this :

i have an input field with button.

if i enter value in the input filed and click on the button it working correctly.

if i enter value in the input field and delete the value and click on the button it is java null pointer exception.

Pls provide some inputs on this.

Thanks in advance.

Regards,

Pavani

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try using this condition as

if ((wdContext.currentContextElement().getVa_Input().trim().equalsIgnoreCase(" ")) ||

(wdContext.currentContextElement().getVa_Input()!=null)||

(wdContext.currentContextElement().getVa_Input().trim().equalsIgnoreCase(""))){

//Your code here

}

Regards.

Rajat

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

What happens if you do not enter the value and then hit the button?

Regards.

Rajat

Former Member
0 Kudos

hi,

if i dont enter value and hit the button it gives a message like" please enter some value " and will not allow user to goahead.

if (wdContext.currentContextElement(). .getVa_comments().equalsIgnoreCase(" ")) {

wdComponentAPI.getMessageManager().reportWarning(

"please enter valid reason");

}

Regards,

Pavani