0
votes

I am getting " Uncaught TypeError: Cannot read property 'dom' of null" error in the console, not sure what is wrong with the following code. Any help is appreciated.

 <div id='fi-form'></div>
 <script>
    CQ.Ext.onReady( function(){


    var card = new CQ.Ext.Panel({
         applyTo : 'fi-form',
         title: 'Example Wizard',
         layout:'form',
         activeItem: 0, 
          bodyStyle: 'padding:15px',
          defaults: {
              // applied to each contained panel
             border:false
           },
      // the panels (or "cards") within the layout

     items: [{
    id: 'card-0',
    xtype: 'fileuploadfield',
    fieldLabel: 'Photo',
    name: 'photo-path',
    buttonCfg: ' '

 }]
});

});
</script>
1

1 Answers

1
votes

It is because of your empty buttonCfg property. Remove it and you shouldn't be seeing this error anymore.

In case you are using CQ 5.5 and above, then it is preferrable to use html5fileuploadfield instead.

<div id='fi-form'></div>
<script>
    CQ.Ext.onReady( function(){
        var card = new CQ.Ext.Panel({
            applyTo : 'fi-form',
            title: 'Example Wizard',
            layout:'form',
            activeItem: 0, 
            bodyStyle: 'padding:15px',
            defaults: {
                // applied to each contained panel
                border:false
            },
            // the panels (or "cards") within the layout
            items: [{
                id: 'card-0',
                xtype: 'html5fileuploadfield',
                fieldLabel: 'Photo',
                name: 'photo-path'
            }]
        });
    });
</script>