on 03-10-2010 7:47 AM
Hello,
I am following the blog [link|http://wiki.sdn.sap.com/wiki/display/Snippets/WebDynproforJava-+FileDownloadUIElement]
this works fine except for the fact that resource attribute is indeed needed for filedownload element coz it otherwise gives a dump
so how should I populate the resource ? if i just simple keep a resource type attribute then the dump is gone but there is no file.
thanks in advance
B
Hi,
If you are using 7.0 then you need to bind the file download ui to an attribute of type binary and if you are using CE 7.1 then ui must be binded to an attribute of type Resource.
The best way to set the binary attribute is
wdContext.currentContextElement().setBinary(str.getBytes());
And for CE 7.1, set the Resource attribute like
IWDResource resource = WDResourceFactory.createResource(str.getBytes(), "MyFile", WDWebResourceType.TXT);
wdContext.currentContextElement().setResource(resource);
Regards,
Amol
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank you very much for response
following code worked.
i really appreciate all the help
i have rewarded points.
IWDResource resource = WDResourceFactory.createResource(str.getBytes(),
"MyFile", WDWebResourceType.TXT);
wdContext.currentContextElement().setResource(resource);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
the easiest method is to create String (i.e. str) variable, populate it with any text you with,
and then a line of code:
wdContext.currentContextElement().setFileResource(str.getBytes());
Regards,
--
Przemysław
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.