Пример #1
0
 @Override
 public boolean onBrowserEvent(Event event) {
   switch (event.getTypeInt()) {
     case Event.ONCHANGE:
       // When we fire the change event onBlur, we allow it to pass to
       // Widget#onBrowserEvent().
       if (!allowEvent) {
         eventPending = true;
         return false;
       }
       break;
     case Event.ONBLUR:
       // Trigger a change event now.
       if (eventPending) {
         allowEvent = true;
         fileUpload.getElement().dispatchEvent(Document.get().createChangeEvent());
         allowEvent = false;
         eventPending = false;
       }
       break;
   }
   return true;
 }
Пример #2
0
 @UiHandler("uploadModuleBrowseButton")
 void clickUploadModuleBrowseButton(ClickEvent event) {
   uploadModuleFileUpload.getElement().<InputElement>cast().click();
 }
 @UiHandler("uploadFormPanel")
 void reset(FormPanel.SubmitCompleteEvent e) {
   uploadFile.getElement().setPropertyString("value", "");
   uploadFilePath.setText(MSG_CHOOSE_FILE);
 }