Skip to Content

Drag and Drop - SAPUI5

Hello Experts,

I want to create a DIV where external excel files can be dragged and dropped.

Can you please help me with the code.

Regards,

Shama

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Oct 22, 2018 at 07:45 AM

    Shama,

    You don't have to create div.

    Try Upload Collection with file type of excel.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 22, 2018 at 11:57 AM

    Hello Suriya,

    Thank you!

    It serves the exact purpose. Can you also let me know how to restrict multiple file upload? I have used multiple="false", still it allows multiple file upload.

    Regards,
    Shama

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Shama,

      multiple="false"

      This property allows you select only one file when you upload. Still it allows to upload multiple times.

      If you want to handle even that, you have do it in onChange event handler.

      onChange: function(oEvent){
      			if(oEvent.getSource().getItems().length){
      				sap.m.MessageBox.error("Only one item allowed!");
      				throw "Only one item allowed!";
      			}
      			else{
      				//on change upload code
      			}
      		}

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.