Hi,
I'm using SmartGWT 3.1 2013-08-05 with GWT 2.4.0 and I'm having trouble with MultiFileItem.
With Internet Explorer (tested with 8.0 and 9.0 on Windows 7) when I have more than one MultiFileItem on a DynamicForm, and the user selects a file in one that is not the last, the file are always shown in the last MultiFileItem.
Here's some code to reproduce the problem,
Java code:
Here follows the referenced datasources:
The main one:
And the related ones (details):
When running the same example with Firefox and Chrome the problem doesn't occur.
I'm using SmartGWT 3.1 2013-08-05 with GWT 2.4.0 and I'm having trouble with MultiFileItem.
With Internet Explorer (tested with 8.0 and 9.0 on Windows 7) when I have more than one MultiFileItem on a DynamicForm, and the user selects a file in one that is not the last, the file are always shown in the last MultiFileItem.
Here's some code to reproduce the problem,
Java code:
Code:
public void onModuleLoad() { HLayout layout = new HLayout(20); layout.setWidth100(); layout.setAlign(Alignment.CENTER); VLayout vLayout = new VLayout(10); vLayout.setWidth("700"); final DynamicForm form = new DynamicForm(); form.setWidth(250); form.setDataSource(DataSource.get("relMensal")); MultiFileItem multiFilePicker = new MultiFileItem("documents_test"); multiFilePicker.setAttribute("dataSource", "uploadDocumentsMonth"); multiFilePicker.setTitle("Anexar Um"); multiFilePicker.setTitleOrientation(TitleOrientation.TOP); multiFilePicker.setWidth("100%"); multiFilePicker.setColSpan(3); multiFilePicker.setEditButtonPrompt("Add file"); multiFilePicker.setRemoveButtonPrompt("Delete file"); multiFilePicker.setPickerAddAnotherFileButtonTitle("Add other file"); multiFilePicker.setPickerCancelButtonTitle("Cancel"); multiFilePicker.setPickerUploadButtonTitle("Save"); SectionItem secao_um = new SectionItem(); secao_um.setDefaultValue("Seção UM"); secao_um.setSectionExpanded(false); secao_um.setItemIds("documents_test"); MultiFileItem multiFilePicker_two = new MultiFileItem("documents"); multiFilePicker_two.setAttribute("dataSource", "testDocumentsMonth"); multiFilePicker_two.setTitle("Anexar dois"); multiFilePicker_two.setTitleOrientation(TitleOrientation.TOP); multiFilePicker_two.setWidth("100%"); multiFilePicker_two.setColSpan(3); multiFilePicker_two.setEditButtonPrompt("Add file"); multiFilePicker_two.setRemoveButtonPrompt("Delete file"); multiFilePicker_two.setPickerAddAnotherFileButtonTitle("Add other file"); multiFilePicker_two.setPickerCancelButtonTitle("Cancel"); multiFilePicker_two.setPickerUploadButtonTitle("Save"); SectionItem secao_dois = new SectionItem(); secao_dois.setDefaultValue("Seção DOIS"); secao_dois.setSectionExpanded(false); secao_dois.setItemIds("documents"); form.setFields(secao_um, multiFilePicker,secao_dois, multiFilePicker_two); layout.addMember(form); layout.draw(); }
The main one:
Code:
<DataSource ID="relMensal" tableName="DB_FISCALIZACAO.TBL_REL_MENSAL" serverType="sql" inheritsFrom="relPlanoTrabalho" dropExtraFields="false"> <fields> <field type="sequence" name="SEQUENCE" sequenceName="DATABASE.SEQUENCE" primaryKey="true" hidden="true" /> <field includeFrom="planoTrabalho.numProjeto" /> </fields> <operationBindings> <operationBinding operationType="fetch" operationId="porCdPlano"> <whereClause><![CDATA[CODE_PLAN = $criteria.id]]></whereClause> </operationBinding> </operationBindings> </DataSource>
Code:
<DataSource ID="uploadDocumentsMonth" tableName="DATABASE.DS_FILE_MONTH" serverType="sql"> <fields> <field type="sequence" name="SEQUENCE" sequenceName="DATABASE.SEQUENCE" primaryKey="true" hidden="true" /> <field name="docMonth" type="integer" nativeName="CODE_MONTH" foreignKey="month.SEQUENCE" hidden="true" /> <field name="documents_test" type="binary" nativeName="DOC_IMAGE"> <validators> <validator type="serverCustom"> <serverObject lookupStyle="new" className="br.gov.orgao.sistema.server.componentes.classeValidar"/> <errorMessage>$value</errorMessage> </validator> </validators> </field> <field name="document_filesize" type="integer" nativeName="NU_TABLE_DOC" hidden="true" /> <field name="document_date_created" type="datetime" nativeName="DT_UPLOAD_DOC" hidden="true" /> <field name="document_filename" type="text" title="Nome do arquivo anexado" nativeName="TX_NAME_DOC" hidden="true" /> </fields> <operationBindings> <operationBinding operationType="remove" operationId="cancelarRel" allowMultiUpdate="true"> <whereClause> <![CDATA[ DATABASE.TABLE_DOC_MONTH.CD_MONTH = $criteria.codRel ]]> </whereClause> </operationBinding> </operationBindings> </DataSource>
Code:
<DataSource ID="testDocumentsMonth" tableName="DATABASE.DS_DOC_MONTH" serverType="sql"> <fields> <field type="sequence" name="SEQUENCE" sequenceName="DATABASE.SEQUENCE" primaryKey="true" hidden="true" /> <field name="docMonth" type="integer" nativeName="CODE_MONTH" foreignKey="month.SEQUENCE" hidden="true" /> <field name="documents" type="binary" nativeName="DOC_IMAGE"> <validators> <validator type="serverCustom"> <serverObject lookupStyle="new" className="br.gov.orgao.sistema.server.componentes.classeValidar"/> <errorMessage>$value</errorMessage> </validator> </validators> </field> <field name="document_filesize" type="integer" nativeName="NU_TABLE_DOC" hidden="true" /> <field name="document_date_created" type="datetime" nativeName="DT_UPLOAD_DOC" hidden="true" /> <field name="document_filename" type="text" title="Nome do arquivo anexado" nativeName="TX_NAME_DOC" hidden="true" /> </fields> <operationBindings> <operationBinding operationType="remove" operationId="cancelarRel" allowMultiUpdate="true"> <whereClause> <![CDATA[ DATABASE.TABLE_DOC_MONTH.CD_MONTH = $criteria.codRel ]]> </whereClause> </operationBinding> </operationBindings> </DataSource>
Comment