Announcement

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

    MultiFileItem broken - unable to save files

    Smart GWT 4.0d (SmartClient Version: v9.0d_2013-07-02/PowerEdition Deployment (built 2013-07-02));
    IE 10 with compatibity mode, Chrome 27.

    It did work before. Not sure when it went wrong, but we were able to save attachments with 4.0d 2013-06-17)

    1) (minor UI) Opening the add files window, the edit box and the browse button is not visible until we go there with the mouse.

    2) (minor UI) Uploading/Saving caption in invalid. See attached screen shot. (this didn't work even with 2013-06-17)

    3) (major UI) Uploaded file is represented with an empty line. (no file name is visible as it was before)

    4) (blocker) Uploaded record has invalid values. data (binary) length is about 17 - 25 bytes (file was > 800K). (Also data_date_created, date_filename, date_filesize columns are null)

    I guess these are bugs, but please let me know if something have been changed and MultiFileItem needs to be used the other way. Thank you.
    Attached Files

    #2
    FileItem

    Hello!

    I have a error here with FileItem that the problem is that the actual versions are not sending the standard data of the Files.

    eg:

    Code:
    <DataSource 
    	ID="attachment"
    	schema="public"
    	dbName="PostgreSQL"
    	tableName="attachment"
    	dataSourceVersion="1"
    	dataFormat="iscServer"
    	serverType="sql"
    >
    
    <fields>
    	<field name="id"       	        type="sequence"  sequenceName="attachment_id" primaryKey="true" unique="true"  hidden="true">	</field>
    		<field name="data"      	    type="binary"    maxFileSize="52428800"  required="true">    		</field>
    		<field name="id_user" 		    type="integer"   hidden="true"> 				 	  				</field>
    		<field name="id_object"         type="integer"   hidden="true"> 				 	  				</field>
    		<field name="data_source_name"  type="text"      hidden="true"> 				 	  				</field>
    		<field name="name"    		    type="text"      tableName="user_register">	 	  					</field>
    	</fields>
    Now i am not receiving the standard fields:

    data_filename, data_filesize, data_date_created

    In the client i am using this:

    Code:
    
            fileItem = new FileItem("data");
            fileItem.setWidth(200);
            fileItem.setMultiple(false);
            fileItem.setTitle(Dictionary.getConstants().file());
            
            if (dataSource.equals("attachment"))
            	fileItem.setHint(Dictionary.getConstants().maximumFileSizeAttachment());
            else 
            	if (dataSource.equals("attachment_small"))
            		fileItem.setHint(Dictionary.getConstants().maximumFileSizeSmallAttachment());
            
            uploadForm.setFields(idItem, fileItem, userItem, dataSourceItem, objectItem); 
            	
    		this.setMembers(uploadForm);
    		
    		isPictureValidator = new Validator();
    		isPictureValidator.setType(ValidatorType.REGEXP);
    		isPictureValidator.setAttribute("expression", "([^\\s]+(\\.(jpg|png|gif|bmp|JPG|PNG|GIF|BMP))$)"); //check extension
    		isPictureValidator.setErrorMessage(Dictionary.getConstants().fileIsNotImage());
    		isPictureValidator.setStopIfFalse(true);
    	}
    
    	public void save(Integer idObject, Integer idUser, final AsyncCallback<Record> asyncCallback){
    		objectItem.setValue(idObject);
    		
    		if (idUser == null) {
    			userItem.setValue(AuthorizationControl.getInstance().getIdUser());
    		}
    		else
    			userItem.setValue(idUser);
    		
    		
    		if (dataSourceItem.getValue().equals("profile_picture") || dataSourceItem.getValue().equals("resource_picture")) {
    			fileItem.setValidators(isPictureValidator);
    		}
    		
    		DSRequest dsr = new DSRequest();		
    		dsr.setWillHandleError(true);
    		dsr.setTimeout(0);
    		idItem.clearValue();
    		uploadForm.saveData(new DSCallback() {  
                public void execute(DSResponse response, Object data, DSRequest request) {
                	int status = response.getStatus();
                	if(status==DSResponse.STATUS_SUCCESS){
                		if(asyncCallback!=null){
                			asyncCallback.onSuccess(response.getData()[0]);
                			uploadForm.clearValue("data");
            			}
                	}else{
                		asyncCallback.onFailure(new Exception("NOT VALIDATE"));
                	}
                }  
            }, dsr);  	
    	}
    This problem is not happening on
    Smart Client Version: SNAPSHOT v9.0d_2013-05-21/PowerEdition Deployment (built 2013-05-21)

    The version after 21 the raw data have not the fields.
    Here a Raw data working:
    Code:
    [
        {
            data:[
                {
                    id:42754, 
                    data_date_created:"2013-07-03T14:12:51", 
                    id_user:16, 
                    data_filename:"Requisitos Demanda.pdf", 
                    id_object:496237, 
                    data_filesize:69744, 
                    data_source_name:"message", 
                    name:"NPU"
                }
            ], 
            invalidateCache:false, 
            isDSResponse:true, 
            operationType:"add", 
            queueStatus:0, 
            status:0
        }
    ]
    sorry my english, tks

    Comment


      #3
      This regression is addressed in all versions, 8.3/3.1 onwards, and will be available as of builds dated July 5

      Comment


        #4
        Smart GWT 4.0p (SmartClient Version: v9.0p_2013-07-10/PowerEdition Deployment (built 2013-07-10))

        All have been fixed except 2). Thank you.

        Comment


          #5
          That's been fixed now - please retry with a build dated July 15 or later

          Comment


            #6
            Smart GWT 4.0p (SmartClient Version: v9.0p_2013-07-15/PowerEdition Deployment (built 2013-07-15))

            2) still doesn't work with the latest version.

            Comment


              #7
              We're getting a "works for us" with this, so we'll need to see a runnable example that shows the issue

              Comment


                #8
                Should it work on the official test page?
                http://smartclient.com/smartgwtee/showcase/#multi_file
                Attached Files

                Comment


                  #9
                  Any update on this? Tested with "SmartClient Version: v9.0p_2013-08-19/PowerEdition Deployment (built 2013-08-19)", and I was still able to repeat. Thank you.

                  Comment


                    #10
                    This turned out to be an issue in the base language pack, which has now been fixed - please retest with a build dated August 24 or later

                    Comment


                      #11
                      Fixed

                      Thank you.

                      Comment

                      Working...
                      X