Hey guys. One of the examples you have in Valence 2.2 and 3.2 is called FILE UPLOAD TO IFS. In this example you are creating a panel to do this. I want to do something simular with my project but I need it to be a window not a panel becuase the user is suppose to right click on an item in a grid then select the option to upload an image to the IFS folder whenever we create a new item # and a new image for that item. Unless i am wrong a panel must be shown on a separate standalone "window" where a window will just pop up and still still show the grid underneath it.
Anyway I took your UPLOAD example and put it in my code (with a minor tweek in the name) and I figured Id try putting the upload panel within a window but the errors im getting doensnt make sense.
When the user right clicks on the grid funciton fnUpload is called This function SHOULD show the window DisplayUpload that has the upload panel i borrowed from cnx called UploadPanel
When i run my app I get two messages that says
Uncaught Type Error Cannot read property 'events' of undefined
Uncaught Type Error Cannot call method 'getvaluee' of null
When I use chrome I click on each error in the console it shows me some script thats not my code so I dont know where the error is located. below is my code for the function, window, and panel. Doesnt Type Error mean that I misspelled something but I dont think I did.
// Function to display the Photo image of the Item # depending on the Item # you clicked on in the grid
// window to display PO detail
Anyway I took your UPLOAD example and put it in my code (with a minor tweek in the name) and I figured Id try putting the upload panel within a window but the errors im getting doensnt make sense.
When the user right clicks on the grid funciton fnUpload is called This function SHOULD show the window DisplayUpload that has the upload panel i borrowed from cnx called UploadPanel
When i run my app I get two messages that says
Uncaught Type Error Cannot read property 'events' of undefined
Uncaught Type Error Cannot call method 'getvaluee' of null
When I use chrome I click on each error in the console it shows me some script thats not my code so I dont know where the error is located. below is my code for the function, window, and panel. Doesnt Type Error mean that I misspelled something but I dont think I did.
// Function to display the Photo image of the Item # depending on the Item # you clicked on in the grid
Code:
function fnUpload() { currentRecord = Ext.getCmp('mainINR0185Grid').getSelectionModel().getSelected(); var getItem = currentRecord.get('IT_ITEM'); var getImage = currentRecord.get('IT_PATH'); // Ext.getCmp('UploadPanel').show(); DisplayUpload.show(); }
Code:
var DisplayUpload = new Ext.Window({ closeAction: 'hide', closable: false, draggable: true, layout: 'fit', modal: true, title: 'Upload a File', items: [UploadPanel], height: 500, width: 600, // x:25, // y:25, resizable: true }); // form panel for selecting file to upload var UploadPanel = new Ext.FormPanel({ id: 'UploadPanel', fileUpload: true, // !important: must specify that this form is for a file upload // width: 500, x: 1, y: 1, frame: true, title: 'File Upload Form', autoHeight: true, bodyStyle: 'padding: 10px 10px 0 10px;', labelWidth: 35, labelAlign: 'right', defaults: { anchor: '95%', allowBlank: false, msgTarget: 'under' }, // !important: sid, opt and pgm must be inserted into form as hidden fields so that they get passed as variables on form submission items: [{ xtype: 'hidden', id: 'sid', value: sid }, { xtype: 'hidden', id: 'opt', value: opt }, { xtype: 'hidden', id: 'pgm', value: 'exupload1' // !important: you must specify the name of your program to call to retrive the file }, { // !important: this field definition defines the file selection field // it must have an id of "file" and it must be specified last in the list of fields on the form xtype: 'fileuploadfield', id: 'file', emptyText: 'Click Browse to select file', fieldLabel: 'File', buttonCfg: { text: 'Browse...', iconCls: 'magnifier' } }], buttons: [{ text: 'Upload', iconCls: 'arrow_up', handler: function(){ if(UploadPanel.getForm().isValid()){ UploadPanel.getForm().submit({ url: 'vvupload.pgm', waitMsg: 'Uploading file...', success: function(UploadPanel, o){ Ext.Msg.show({ title: 'Success', msg: o.result.msg, buttons: Ext.Msg.OK, icon: Ext.MessageBox.INFO }); }, failure: function(UploadPanel, o) { Ext.Msg.show({ title: 'Failure', msg: o.result.msg, buttons: Ext.Msg.OK, icon: Ext.MessageBox.ERROR }); } }); } } },{ text: 'Clear', iconCls: 'cancel', handler: function(){ // UploadPanel.getForm().reset(); DisplayUpload.hide(); } }] });
Comment