cancel
Showing results for 
Search instead for 
Did you mean: 

Save/Store of empty inputfield

Former Member
0 Kudos

Hi,

how can i save an empty inputfield?

I cant save a String like "" only " "...

Regards

Christian

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member211296
Participant
0 Kudos

Hai,

try this coding.

if you have the attribute name as value.

String value="";

if(wdcontext.currentcontextelement().getvalue()!=null)

{

value=wdcontext.currentcontextelement().getvalue();

}

then if there is no value in the input field value="" .

Kind Regards,

Hariprasath.R

Former Member
0 Kudos

Hi,

String val=wdContext.currentContextElement().getXX();

if(val==null)

val="";

Regards,

Naga

Former Member
0 Kudos

ok, but i cant save ""

Former Member
0 Kudos

if the inputfield i sempty its not null...

Former Member
0 Kudos

Hi,

Where you want to store the data?

String val=wdContext.currentContextelement().getXX();

if(val==null || val.trim().equals(" "))

val="null";

Regards,

Naga

Former Member
0 Kudos

Hi,

One way is to save the value as <b>null</b>.

Former Member
0 Kudos

the i get an null pointer exception...

Former Member
0 Kudos

Hi,

If you are trying to save the value in backend then the field which holds the input value should accept null values.