cancel
Showing results for 
Search instead for 
Did you mean: 

Should i can blank FileUpload Ui ?

Former Member
0 Kudos

Hi,

When i should not pass value in FileUpload ui it gives error of "Null Pointer" . But i want to put FileUpload ui as optional. Is this possible ?

Regards,

Gurprit Bhatia

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi



if ( wdContext.current<valueNode>Element().getFileResource() != null ){
   try{
       // Syntax for file upload
   } catch(NullPointerException e){ }

} else{
     //  navigate
}

Mandeep Virk

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Gurprit,

This is known limitation from webdynpro side. U can't handle it bcos it is handled by framework.

regards

Sumit

srinivas_sistu
Active Contributor
0 Kudos

Hi,

I hope You are getting that exception because, when user is not giving input to the File UI Element still you are getting the context data and doing some opperation on that....

So before doing any coding on the image attributes, check for not null condition....

Like this...

if (wdContext.currentFileImageElement().getUpload() != null)

{

your coding here.....

}

else

{

....

}

Where Upload is you binary context element....

Regards,

Srinivas.

Former Member
0 Kudos

if you want to explicitly neglect the fileupload UI element ( I suppose you are writing or getting some attributes from the FileuploadedUI element) .

You need to code those code snippets in the try catch block to by pass NullPointerException.

try{

} catch (NullPointerException e){}

I think you got the idea or else post the code

Mandeep Virk

PradeepBondla
Active Contributor
0 Kudos

Hi,

you can put some condition, where if condition is ture activate the file upload ui element by making "enabled" property as true, otherwiese make it false.

regards,

Pradeep