Announcement

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

    BatchUploader file input button text showing "Select Files"

    I am using batchuploader that shows "Choose Files" label on button.
    Click image for larger version

Name:	Capture.JPG
Views:	63
Size:	1.9 KB
ID:	260464

    My requirement is to allow one file at a time and in that case the button label should be "Choose File" not "Choose Files"
    I tried the below solution.
    Code:
      batchUplaoder
                    .addPreviewShownHandler(previewShownHandler -> {
                        batchUploader.[HTML][/HTML]getUploadFileItem().getUploadItem().setMultiple(false);
                    });
    This should set the multiple selection to false but it;s not working. Any suggestions?
    Thanks in advance.

    #2
    Hi preeti_kanyal,

    this is an autoChild. Please see this code here (v12.0p_2019-12-14) to see how it is working in SmartClient - SmartGWT should be the same with setAutoChildProperties().
    Code:
    isc.BatchUploader.create({
        height: 400,
        width: "100%",
        uploadDataSource: supplyItemCustom,
        uploadFileItemProperties: {
            multiple: false
        }
    });
    Isomorphic: Perhaps this should be the default, as uploading two files does not work anyway.

    Best regards
    Blama

    Comment


      #3
      Thanks Blama . This component allow to select more than one files and shows the count like given in screenshot. But it only uploads one file. So I just want to show button label as "Choose File" instead of "Choose Files" and allow to select one file only.

      Comment


        #4
        Hi,

        did you try the code? It does exactly that.

        Best regards
        Blama

        Comment


          #5
          Thanks Blama ,
          Your suggested solution worked.
          Code:
             FileItem fileItem = new FileItem();
                  fileItem.setMultiple(false);
                  batchUploader.setAutoChildProperties("uploadFileItem", fileItem);

          Comment


            #6
            Just to follow up on this: We've now modified the defaults for this FileItem in the framework to mark it as multiple:false
            (The change will be present in 12.0 / 12.1 nightly builds dated Jan 9 and above)

            Regards
            Isomorphic Software

            Comment

            Working...
            X