on 06-24-2008 10:34 AM
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
Hi
Try putting this code in OnAction()
if (wdContext.currentTestElement().getValue() == null){
wdComponentAPI.getMessageManager().reportException("Invalid File ",true);
}
Mandeep Virk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Create an value attribute say Ctx_va_FilePath of type 'binary' in the context of the view.
Set the filepath property of the fileupload ui element to this value.
On pressing of upload button, simply check if the filepath is null or not
using the code
if (wdContext.currentContextElement().getCtx_va_FilePath() != null)
{
//code
}
If filepath is not null, carry on with the execution and if filepath is null , advise the user to select a file first.
Regards,
Sudeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
let assume that Data is context attribute of type binary, and it is bind to a data propety of the fileupload ui element then use the following code
if(wdContext.currentContextElement().getData()==null){
// write ur code here
}
Regards,
Siva Sankar N
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.