I'm using Licenced version of 70RC2a of SC. need to implement file upload in database and render as grid like in upload example of SC.
I've crated an datasource name attachDS.ds.xml as follows.
Having a attachPane code as follows.
Following is the button which is used for upload.
I'm not getting any error on firebug or SC console. But it is not hitting the DMI method on server. nothing happening.
If I change the "type" in datasource of targetfile field to 'text' from 'imageFile' it is immideately hits the post method of DMI.
I've gone through complete documentation of upload and multifile upload.
Please suggest as I'm not able to move forward a bit.
I've crated an datasource name attachDS.ds.xml as follows.
Code:
<DataSource> <ID>attachDS</ID> <title>Attachement</title> <serverType>generic</serverType> <showPrompt>false</showPrompt> <primaryKeyField>dbid</primaryKeyField> <pluralTitle>Attachement</pluralTitle> <subTabTitle>Attachement</subTabTitle> <titleField>title</titleField> <fields> <field> <name>dbid</name> <title>dbid</title> <type>long</type> <primaryKey>true</primaryKey> <hidden>true</hidden> <canEdit>false</canEdit> <length>10</length> </field> <field> <name>title</name> <title>Title</title> <type>text</type> <required>true</required> <wrap>true</wrap> </field> <field> <name>targetfile</name> <title>File</title> <type>imageFile</type> <required>true</required> <maxFileSize>51200</maxFileSize> </field> </fields> <serverObject lookupStyle="spring" bean="attachDMI" /> <operationBindings> <binding operationType="fetch" serverMethod="get"> <serverObject lookupStyle="spring" bean="attachDMI" /> </binding> <binding operationType="add" serverMethod="post"> <serverObject lookupStyle="spring" bean="attachDMI" /> </binding> <binding operationType="remove" serverMethod="delete"> <serverObject lookupStyle="spring" bean="attachDMI"/> </binding> </operationBindings> </DataSource>
Code:
/* * attachPane form code snippet */ this.form = isc.DynamicForm.create({ name:"uploadForm", encoding:"multipart", canSubmit:true, autoFetchData:false, dataSource:"attachDS", layoutAlign:"center", autoDraw:false, cellPadding: 4, titleOrientation: "left", wrapItemTitles:"false", fields: [] // these fields will automatically populate on page from DS });
Code:
/* * the datasource pointing here is above datasource creates two fields title and upload binary file with brouse button and submit button. */ click : function() { attachPane.form.saveData(null, {params: {singleUpload: true}}); attachPane.form.editNewRecord(); }
If I change the "type" in datasource of targetfile field to 'text' from 'imageFile' it is immideately hits the post method of DMI.
I've gone through complete documentation of upload and multifile upload.
Please suggest as I'm not able to move forward a bit.
Comment