on 01-04-2015 9:29 AM
Hi
I am trying to upload a file but
after I press 'browse' and select
the file to upload, I do not see the
file name in my text input field.
I searched and saw that it is advised to use
sap.ui.unified.FileUpload , but although the
package sap.ui.unified is there, this class cannot
be found in this package.
I will be grateful for any suggestion.
regards
Yuval
HI YUVAL
Here is an example file name is shown correct.
BTW, which version of SAPUI5 are you using.
As Jason has pointed out, sap.ui.commons.FileUploader has been depreciated.
Thanks
-D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Thank you very much for pointing me to this blog.
I have used the following
<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.ui.commons"
controllerName="views.main" xmlns:html="http://www.w3.org/1999/xhtml">
<FileUploader xmlns="sap.ui.commons"> </FileUploader>
</core:View>
And it works nicely!
But I have also looked at the referenced sap_ui_core.js
https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js
and could not find the new unified.FileUploader class.
Regards
Yuval
Looking at your code you are still using the sap.ui.commons.FileUploader, i.e. you are using the "sap.ui.commons" namespace for the FileUploader control. If you changed the xmlns to use "sap.ui.unified' name space it would use the correct control.
The FileUpload is not part of the core library, the correct path for the unified FileUploader would be:
https://sapui5.netweaver.ondemand.com/resources/sap/ui/unified/FileUploader.js
Also make sure you update the bootstrap to include the unified library.
<script id='sap-ui-bootstrap' type='text/javascript'
src='https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js'
data-sap-ui-theme='sap_goldreflection'
data-sap-ui-libs='sap.ui.commons,sap.ui.unified'>
Regards,
Jason
Hi Jason
I checked the jar version and it is com.sap.ui5.unified_1.20.7.jar.
Anyway 'FileUploader' is not part of this js file contained therein.
I managed however to download the javascript file
from the link you provided to then include
it in my project 'Libraries'. I also followed your good advice and
referenced this file in index.html :
<script id='sap-ui-bootstrap' type='text/javascript'
src='resources/sap.ui.unified.js'
data-sap-ui-theme='sap_goldreflection'
data-sap-ui-libs='sap.ui.commons,sap.ui.unified'>
However when I try to include FileUpload in my xx.view.xml
I cannot locate this file.
What have I done wrong.?
I really appreciate your assistance here.
Regards
Yuval
Hi Yuval,
You shouldn't need to copy any files, how are you runnng the applications via Eclipse? The .js files should be under the META-INF/resources directory in the jar file,
Looking at your bootstrap, you hav changed the src path, this should still point to the sap-ui-core.js, the unified lib should only be added to the data-sap-ui-libs.
<script id='sap-ui-bootstrap' type='text/javascript'
src='resources/sap-ui-core.js'
data-sap-ui-theme='sap_goldreflection'
data-sap-ui-libs='sap.ui.commons,sap.ui.unified'>
When you say you can't locate the file do you mean in the browser debugger? If you look in the network tab, do you see the files are requested?
It might be worth looking at the FileUploader test page.
https://sapui5.hana.ondemand.com/sdk/#test-resources/sap/ui/unified/FileUploader.html
Many thanks,
Jason
Hi Yuval,
Not sure if it's a typo, however the correct control name is sap.ui.unified.FileUploader
What version are you using? The sap.ui.commons.FileUploader has been deprecated since 1.21.0.
Regards,
Jason
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
74 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.