on 05-15-2009 10:55 AM
Hi all,
I am using File Upload UI for one my application, for that i created a context attribute of type
com.sap.ide.webdynpro.uielementdefinitions.Resource
, i placed one button which has the action whether any file was selected or not.
public void onActionuploadSelectedFile(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
if(wdContext.currentContextElement().getCaResource()!=null)
{
wdComponentAPI.getMessageManager().reportSuccess("File Selected");
}
else
{
wdComponentAPI.getMessageManager().reportSuccess("File not Selected");
}
i am getting the message
File not Selected
when no file was seleted. But when i select a file i am not getting any message.
Kindly help me and let me know where is the actual problem....
Currently I am using NWDS 7.0.11
Thanks & Regards,
Chandran S
Hi,
Finally the issue was solved by refering the thread
The multipart-form is never parsed. To do so, we have to
start Visual Admin, then
go to "Cluster" tab/Server .../Services/Web Container,
then tab Properties,
then change MultipartBodyParameterName from "empty string" to "com.sap.servlet.multipart.body"
Thanks & Regards,
Chandran S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
The other issue related to this File Upload UI, its masking the functionalities of the other UI elements in the screen if any file already selected in that File Upload UI element. The other UI's are wroking fine if nothing is selected in that File Upload UI.
Kindly help me to resolve the issue.....
Thanks in Advance.
Thanks & Regards,
Chandran S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
See the code & procedure in sample project in below link. Hope this helps.
/docs/DOC-8061#41 [original link is broken]
Regards,
Charan
Hi Charan,
I already downloaded this sample code and executed not working, for me the issue is different, as i already mentioned i am not able to get the file contents and also if a file is selected in file upload UI, the other UI functionalities are getting masked.
Kindly help me in resloving this issue.
Regards,
Chandran S
Hi,
Please carefully check the below properties(cardinality, selection && types) and bindings.
1. Create a value node(Ex: ctx_vn_FileData) of cardinality 0..1 and selection 0...1
2. Create a context attribute(Ex: ctx_va_FileResource) of
type "com.sap.ide.webdynpro.uielementdefinitions.Resource" under this node.
3. Check you binded this context attribute to resource property of FileUpload UI element.
4. Now you can get the value of this resource using below code.
IPrivateUploadFileKM_View.ICtx_vn_FileDataElement element = wdContext.currentCtx_vn_FileDataElement();
IWDResource resource = element.getCtx_va_FileResource();
4. You can get the resource(file) name & resource(file) extension using below code.
//Read the File
InputStream stream = resource.read(true);
String resourceName = resource.getResourceName();
String resourceExtn = resource.getResourceType().getFileExtension();
Check that you did all these as it is??
Regards,
Charan
Hi,
Refer to this tutorial:
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
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.