Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Problem with MultiFileItem in IE

    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:
    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();
    }
    Here follows the referenced datasources:

    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>
    And the related ones (details):

    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>
    When running the same example with Firefox and Chrome the problem doesn't occur.
    Last edited by basis.cedric; 24 Sep 2013, 13:42. Reason: Quick save

    #2
    This is assigned to a developer for investigation.
    Can you confirm that this occurs in compiled mode (not just development mode)?
    Also, if you haven't already, it's always worth sanity checking against the latest nightly build in case this issue has already been addressed.

    Regards
    Isomorphic Software

    Comment


      #3
      Hello,
      I didn't test in Development mode, only with compiled code where I encountered the problem.
      I'll try with a more recent build to see if this happens too.

      Comment


        #4
        We're not seeing this behavior with your test-case against latest code (tested 8.3, 9.0 and 9.1, and both IE and FireFox).

        Note that we couldn't run your code exactly as-is - we had to comment out a field which was an includeFrom from a DS called "month" which you didn't provide, there was a validator that needed a server-object, and we altered the schema part of the tableName and removed the sequenceName from each so we could import them.

        The best next step is indeed to try with the latest from smartclient.com/builds.

        If you still see issues, please re-hash your sample a bit so that it still shows the issue, but is entirely standalone so we can run it as you provide it.

        Comment


          #5
          I've tested against 3.1p-2013-11-30 with the same code and now the filename is not appearing in the first MultiFileItem.
          If I switch the multifileitems it's always the first one that shows this behavior.
          Attached Files

          Comment


            #6
            We're still not seeing this behavior. We can add one or more files to either MultiFileItem and see the file-names in the correct grid, and we can open and close the sections and see no ill effects.

            We're really going to need to see a standalone test case that we can just drop into a project and run to see the problem, without having to make a bunch of local changes first to make it work.

            Comment


              #7
              A standalone test case was supplied offline.
              We have now resolved this issue.

              Please try the next nightly build dated Dec 13 or above

              Regards
              Isomorphic Software

              Comment


                #8
                Good to know, I'll give it a try tomorrow.
                Thanks.

                Comment


                  #9
                  I've tested with 3.1p-2013-12-13 and it worked.
                  Thanks.

                  Comment

                  Working...
                  X