Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Cross Window Drag?

    I'm unable to find an example in the Showcase as referenced in the blog post. Do you have a link please? Or is it the same as you would Drag & Drop within the same page, and automatic, and no demo is even required?

    Also, it got me to thinking, I would really like something like this:
    Code:
    //pseudocode
    FileItem fileItem = new FileItem("DOCUMENT", "Upload a Document") {
     {
      setEditorProperties(new CanvasItem(){
       {
          setId("DropZone");
          setEmptyDisplayValue("Drag & Drop your file here...");
          setCanAcceptDroppedFile(true);
          
          addDroppedFileHandler(new DroppedFileHandler(){
      
         @Override
          public void onDroppedFile(DroppedFileEvent event){
           
          getParentForm.saveData(event.getDroppedFile);
         }       
        });      
       }     
      });    
     }
    };
    So that's two aspects:

    1) Instead of the FileItem as constructed now, an alternate "dropbox" CanvasItem (ListGridItem?) that can perform an action immediately onDroppedFile. Or collect multiple items, then use a Submit button.

    2) Drag of File from separate WebDav window. Different from Cross Window Drag example in that you are not dragging a Smart GWT object (E.g. Record), you'd be dragging a WebDav item. I don't know exactly what a WebDav item is, but here's an example from a page I have:
    Code:
    <script>// Copyright (c) 2010 The Chromium Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style license that can be
    // found in the LICENSE file.
    
    // Invoke the template engine previously loaded from i18n_template.js
    i18nTemplate.process(document, templateData);
    </script><script>start("\\\\myFileServer\\myVolume\\myFolder\\mySubFolder\\Forms_Word_Templates\\SECTIONQ\\");</script>
    <script>addRow("..","..",1,"0 B","1/31/14 8:55:17 AM");</script>
    <script>addRow("ABC 4077.pdf","ABC%204077.pdf",0,"1.3 MB","10/9/13 2:57:13 PM");</script>
    <script>addRow("ABC 8716.pdf","ABC%208716.pdf",0,"415 kB","10/9/13 2:57:53 PM");</script>
    <script>addRow("ABC002.pdf","ABC002.pdf",0,"40.5 kB","5/16/13 11:57:23 AM");</script>
    <script>addRow("ABC004.pdf","ABC004.pdf",0,"38.7 kB","5/31/13 2:23:17 PM");</script>
    <script>addRow("ABC007.pdf","ABC007.pdf",0,"48.7 kB","3/29/11 4:20:35 PM");</script>
    <script>addRow("ABC010.pdf","ABC010.pdf",0,"41.4 kB","6/22/12 8:05:23 AM");</script>
    <script>addRow("ABC010s.pdf","ABC010s.pdf",0,"42.2 kB","6/25/12 4:29:11 PM");</script>
    <script>addRow("ABC011.pdf","ABC011.pdf",0,"59.4 kB","3/29/11 4:21:13 PM");</script>
    <script>addRow("ABC020.DOT","ABC020.DOT",0,"52.0 kB","7/19/13 2:12:58 PM");</script>
    <script>addRow("ABC021.pdf","ABC021.pdf",0,"40.0 kB","5/20/11 12:44:02 PM");</script>
    Use case would be user has to upload hundreds of files. FileItem requires at least 3 mouse clicks (Browse; select; Open). Drag & Drop could be lots faster.

    If any of this is possible now, please advise.

    Thanks!

    #2
    The sample is in 4.1, so you need to download a 4.1 SDK to see it (from smartclient.com/builds).

    FileItem features along the lines of what you want are planned - use Feature Sponsorship to accelerate them and get a specific date commitment.

    To implement them today, you'd need to start from an HTMLFlow and write your own HTML and native event handlers (which is fraught with peril due to browser bugs in this area).

    Comment


      #3
      YES!!! Awesome, great, thanks!

      Originally posted by Isomorphic View Post
      ...you'd need to start from an HTMLFlow and write your own HTML and native event handlers...
      I use Smart GWT to avoid stuff like this :) I'll wait...
      Attached Files

      Comment

      Working...
      X