Cannot read property 'g' of undefined

So I would like to call the FileUpload Wizard with a button at DesignToolbar,
the dialog can be shown but it can not upload file

It shows a bug occured :
foundIn = none
faultData = com.google.gwt.event.shared.UmbrellaException: Exception caught: (TypeError) : Cannot read property ‘g’ of undefined

My Code

private class showAssetsDialogAction implements Command {
     @Override
     public void execute() {
          new FileUploadWizard(assetsFolder).center();
     }
}

It looks like you’re minimizing your sources. What happens if you turn off the optimizations and pretty print? That will give you a more useful name than ‘g’ to go on.

Hello, i have turned off the optimizations and the error is

com.google.gwt.event.shared.UmbrellaException: Exception caught: (TypeError) : Cannot read property ‘fileId’ of undefined

Hello, it is because there are no ProjectChangeListener at the Toolbar, so it can not get FolderNode,
I finally figured out a simple solution, which is to get AssetFolder from AssetList

new FileUploadWizard(assetsFolder).center();

is changed to :

new FileUploadWizard(AssetList.assetsFolder).center();
1 Like