cancel
Showing results for 
Search instead for 
Did you mean: 

How i validate fileupload ui means it should not be blank

Former Member
0 Kudos

Hi,

How i validate fileupload ui means i have to put validation that fileupload ui should not be blank.So how i check that one ? please provide code if possible.

Regards,

Gurprit Bhatia

View Entire Topic
0 Kudos

hi,

Check whether file resource is null if it is null then display the message of no file


IPrivateFileUploadView.IContextElement element =
      wdContext.currentContextElement();

    //	if a file in the FileUpload field exists
if (element.getFileResource() != null) 
{
.......
}
else
{
    message of no file
} 

Former Member
0 Kudos

Thanks for quick ans.

i tried that one but it gives null pointer error.

Regards,

Gurprit Bhatia

Former Member
0 Kudos

Hi

Well can you give a print of the exception.

And also check if you have bound the property filename to a context attribute of type string.

Regards,

Sudeep