Announcement

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

    Problem while selecting the choose file before upload after upgraded swartgwt 12.0

    Hi Isomorphic,

    After upgraded to smartgwt 12.0, I am facing issue while choosing file before uploading. It used to work before. Now I need to choose the file before upload. First time when I select the file and say open it is not working, but second time when I select the file and say open I can see the file name after choose file. I got this problem after upgraded to 12.0.

    Please help me on this.

    Thank you
    Rani


    #2
    This has not been previously reported and online samples are working fine. Please provide a minimal, ready-to-run test case that shows that this is a framework issue as opened to an issue in your application code.

    Comment


      #3
      Hi Isomorphic ,

      This is the code I am using

      public ProspectPlanAttachmentFormPane(final IProspectService prospectService,
      final ListGridRecord record, final long constituentId, final int width, final boolean isEdit) {
      super(prospectService, record, constituentId, isEdit);
      this.prospectService = prospectService;
      this.isEdit = isEdit;
      if (isEdit) {
      this.documentId = record
      .getAttribute(ProspectDSConstants.DOCUMENT_ID);
      this.persistedDocumentId = record
      .getAttribute(ProspectDSConstants.DOCUMENT_ID);
      this.persistedDocumentName = record
      .getAttribute(ProspectDSConstants.FILE_NAME);
      }
      VLayout vLayout = new VLayout();
      vLayout.setWidth100();
      vLayout.setMargin(LAYOUT_MARGIN);

      uploadFilePanel = new UploadFilePanel(this);
      uploadFilePanel.getUploadForm().getItem(DocumentDS.FILE)
      .setTitle(Constants.prospect.fileTitle());
      uploadFilePanel.getUploadForm().getItem(DocumentDS.DESCRIPTION).setWidth(UPLOAD_PANEL_WIDTH);
      uploadFilePanel.getUploadForm().setMargin(UPLOAD_PANEL_MARGIN);
      uploadFilePanel.getUploadForm().getItem(DocumentDS.DESCRIPTION)
      .setTitleAlign(Alignment.LEFT);
      uploadFilePanel.getUploadForm().getItem(DocumentDS.FILE)
      .setTitleAlign(Alignment.LEFT);
      uploadFilePanel.setWidth100();
      uploadFilePanel.getUploadForm().getItem(DocumentDS.DESCRIPTION).addChangedHandler(new ChangedHandler() {
      @Override
      public void onChanged(final ChangedEvent event) {
      setMode(EDIT_MODE);
      }
      });

      uploadFilePanel.getUploadForm().getItem(DocumentDS.FILE).addClickHandler(new ClickHandler() {
      @Override
      public void onClick(final ClickEvent event) {
      setMode(EDIT_MODE);
      }
      });

      vLayout.addMember(uploadFilePanel);
      uploadedFileDetails = new DynamicForm();
      FormItem uploadedFileName = createStaticTextItem(
      ProspectDSConstants.uploadedFile,
      Constants.prospect.uploadedFileTitle(),
      getAttribute(ProspectDSConstants.FILE_NAME, record));
      uploadedFileName.setStartRow(true);
      uploadedFileName.setVisible(Boolean.FALSE);
      uploadedFileDetails.setFields(uploadedFileName);
      vLayout.addMember(uploadedFileDetails);
      HLayout hLayout = new HLayout();
      hLayout.setWidth100();
      HTML dum = new HTML(" ");
      dum.setWidth("100");
      hLayout.addMember(dum);
      hLayout.addMember(vLayout);
      addMember(getForm(), 0);
      addMember(hLayout, 1);

      if (isEdit) {
      uploadFilePanel.getUploadForm().getItem(DocumentDS.DESCRIPTION).setValue(record.getAttribute(ProspectDSConstants.DESCRIPTION));
      getUploadedFileDetails().getItem(ProspectDSConstants.uploadedFile).setVisible(Boolean.TRUE);
      }
      }

      and I attached screen shot

      Thank you
      Attached Files

      Comment


        #4
        See previous response.

        Please provide a minimal, ready-to-run test case that shows that this is a framework issue as opened to an issue in your application code.
        This is not ready-to-run and not minimal. Please see the Debugging overview and the forums FAQ to understand what you need to post to make it possible to help you.

        Comment


          #5
          Hi Isomorphic
          This is the error I have seen at console

          File chooser dialog can only be shown with a user activation.

          Thank you

          Comment


            #6
            Hi Isomorphic,

            can I have sample code to upload file using UploadFilePanel in java. I have gone through the examples on show case. Those are xml and Js based. I could upload the file previously. But after upgraded smartgwt 12.0, I need to clock the button twice. I couldn't figure it why? pelase help me on this.

            Thank you
            Rama

            Comment


              #7
              Sorry small correction to the above post. I need to click choose File button two times. This is the problem. Upload file is working. But choose File button need to select two times instead of one.

              Thank you
              Rama

              Comment

              Working...
              X