1. #1
    Ext User
    Join Date
    Sep 2009
    Posts
    21
    Vote Rating
    0
    ipreti is on a distinguished road

      0  

    Default File Uploader field disapear after second time being rendered

    File Uploader field disapear after second time being rendered


    Hi guys.
    Im facing a weird problem while trying to build a form with FileUploader plugin.
    Every time i get the form with this field opened it simply disapear.
    The code is :

    Code:
    var fileupload = new Ext.ux.form.FileUploadField({
                id: 'form-file',
                width: 400,
                emptyText: 'Select a file',
                fieldLabel: 'File',
                name: 'file',
                buttonText: '',
                buttonCfg: {
                    iconCls: 'upload-icon'
                }
    
            });
    
      form.add(fileupload);
    where form is my form.
    I dont perform any logic to enable or disable this field. It just disapear by itself at the second time i get the form opened.
    Anyone knows what could be happening?
    Thanks in advance.

  2. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,360
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    try adding: form.doLayout(); after form.add(fileupload);

    You need to call doLayout to actually perform the DOM manipulation necessary.

    I cover this stuff in the early chapters of Ext JS in Action: http://manning.com/garcia

  3. #3
    Ext User
    Join Date
    Sep 2009
    Posts
    21
    Vote Rating
    0
    ipreti is on a distinguished road

      0  

    Default


    Thanks jgarcia for the reply.
    I've actually found the reason for this weird behavior.
    When using fileuploader plugin it is necessary to give diferent ids to each instance that you put in your form (or diferent forms).
    So.. i settled a static constant inside my class that get incremented and concatenated in the id value.
    This action sort out my problem.
    Ivan.

Thread Participants: 1