B4J Tutorial [BANanoWebix] Lesson 22 - Method 3 (DropZone)

Discussion in 'B4J Tutorials' started by Mashiane, Jul 1, 2019.

  1. Mashiane

    Mashiane Expert Licensed User

    Ola

    Lesson 22 - Method 1
    Lesson 22 - Method 2

    This method involves the dropzone where one can drag and drop files into the uploader.

    Lesson22.3.gif

    A list is placed on a page..

    Code:
    Dim lst As WixList
        lst.Initialize(
    "mylist").SetTypeUploader(True).SetHeight(600).SetWidth(300).SetScroll(False)
        
    '
        R1.AddItem(lst.Item)
        
    '
        pg.AddRow(R1)
        
    '
        pg.ui
    This is linked to the uploader with the .SetTypeUploader(True) call.

    Then after the page is created, an uploaded is created, added to the page (it will be invisible) and then a dropzone between the list (mylist) and the uploader (upload) is created with the page's .AddDropZone method..

    Code:
    ' create an uploader and add it to the page in run-time
        Dim upload As WixUploader
        upload.Initialize(
    "upload").SetApiOnly(True).SetLink("mylist").SetUpload("./assets/upload.php").SetApiOnly(True)
        
    '
        fu = pg.AddUploader(upload)
        
        
    'add event
        Dim ffile As BANanoObject
        pg.OnFileUploadError(
    "upload", BANano.CallBack(Me, "onFileUploadError"Array(ffile)))
        pg.onFileUpload(
    "upload", BANano.CallBack(Me, "onFileUpload"Array(ffile)))
        
        
    'add a dropzone for uploader linked to the list
        pg.addDropZone("upload""mylist")
    We link the list with the uploader by running .SetLink('mylist') call and then link the uploader named 'upload' with the list named 'mylist' with the .AddDropZone call. This enables the bottom part of the list to be a dropzone.

    Ta!
     
    joulongleu likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice