1. #21
    Sencha User loeppky's Avatar
    Join Date
    May 2007
    Location
    Seattle, WA
    Posts
    230
    Vote Rating
    0
    loeppky is on a distinguished road

      0  

    Default


    Ramsay: in addition to the example t34 posted in post #8, the sample I posted in post #2 could be easily modified to do this.

  2. #22
    Ext User
    Join Date
    Mar 2008
    Posts
    32
    Vote Rating
    1
    dotchris is on a distinguished road

      0  

    Default


    Anyone else having the issue where it takes 2 clicks to get it to bring up the dialog to pick a file?

  3. #23
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,748
    Vote Rating
    106
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      0  

    Default


    Quote Originally Posted by dotchris View Post
    Anyone else having the issue where it takes 2 clicks to get it to bring up the dialog to pick a file?
    Sometimes I can click up to 10 times before the browsebutton reacts, seen this in IE6/IE7. Will dig into it soon, let you know if I find something... I think the error is in the function below, not sure what it's for:

    onButtonMouseMove: function(e){
    var xy = e.getXY();
    xy[0] -= this.FLOAT_EL_WIDTH / 2;
    xy[1] -= this.FLOAT_EL_HEIGHT / 2;
    this.floatEl.setXY(xy);
    }

    Whenever my browsebutton stops working, I can always get it to work by moving the mouse from the button and then try again...

  4. #24
    Ext User
    Join Date
    Apr 2008
    Location
    Switzerland, St-Blaise (NE)
    Posts
    7
    Vote Rating
    0
    4him is on a distinguished road

      0  

    Lightbulb more than one click needed issue

    more than one click needed issue


    Originally Posted by dotchris View Post
    Anyone else having the issue where it takes 2 clicks to get it to bring up the dialog to pick a file?
    Sometimes I can click up to 10 times before the browsebutton reacts, seen this in IE6/IE7. Will dig into it soon, let you know if I find something... I think the error is in the function below, not sure what it's for:

    onButtonMouseMove: function(e){
    var xy = e.getXY();
    xy[0] -= this.FLOAT_EL_WIDTH / 2;
    xy[1] -= this.FLOAT_EL_HEIGHT / 2;
    this.floatEl.setXY(xy);
    }

    Whenever my browsebutton stops working, I can always get it to work by moving the mouse from the button and then try again...
    It does it in IE for me, but not when in debug mode. I have found a workaround by applying the background styles to the clip element also when not in debug mode:

    Code:
    this.clipEl.applyStyles({
    	'background-color': 'green'
    });
    this.floatEl.applyStyles({
    	'background-color': 'red'
    });
    
    if (!this.debug) {
    	this.clipEl.setOpacity(0.0);
    }
    instead of:

    Code:
    if (this.debug) {
    	this.clipEl.applyStyles({
    		'background-color': 'green'
    	});
    	this.floatEl.applyStyles({
    		'background-color': 'red'
    	});
    } else {
    	this.clipEl.setOpacity(0.0);
    }
    Maybe loeppky will want to add that to his code...

  5. #25
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,748
    Vote Rating
    106
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      0  

    Default


    Very nice discovery, cannot reproduce the error now. Though it truly puzzles me why setting a background solves this problem... huhuh

  6. #26
    dddu88
    Guest

    Default I got path has no properties error

    I got path has no properties error


    Hi, all,
    I am trying to get the BrowseButton to work, I got an error: "path has no properties", I debugged into the code, and found it happened due to this.buttonSelector is undefined when the execution comes to

    Code:
    // Cover cases where someone tabs to the button:
    		// Listen to focus of the button so we can translate the focus to the input file el.
    		var buttonEl = this.el.child(this.buttonSelector);
    Here is my code:

    Code:
    var filefield = new Ext.form.TextField({
                    id: 'filefield',
                    region:'center',
                    width:150,
                    height:100,
                    allowBlank:true
            });
            var browseButtonBaseConfig = {
    			xtype: 'browsebutton',
    			region:'east',
    			handler: function(){},
    			scope: this,
    			tooltip: 'Select a file.',
    			inputFileName: 'screenshot',
    			debug: false // set to true to see the "Browse" overlay
    		};
            var bbutton = new Ext.ux.form.BrowseButton(Ext.apply({
    				text: 'Browse'
    			}, browseButtonBaseConfig));
    			
            var browsepanel = new Ext.Panel({
    	        id:'browsepanelid',
    	        layout:'border',
    	        width:320,
    	        height:100,
    	        plain: true,
    	        items: [filefield, bbutton]
    		});
            var mywin = new Ext.Window({
                    labelWidth: 150, // label settings here cascade unless overridden
    	       frame:true,
    	       title: 'Select a file:',
    	       bodyStyle:'padding:5px 5px 0',
    	       buttonAlign: 'center',
    	       closable: true,
    	       draggable: true,
    	       width:320,
    	       height:240,
    	       modal:false,
    	       closeAction: 'close',
    	       plain:true,
    	       resizable: true,
                    items: [{
                            xtype: 'form',
                            labelWidth: 75,
                            labelAlign: 'right',
                            bodyStyle: 'background-color:#DFE8F6; padding-top:10px',
                            border: false,
                            items: [{
    		      xtype:'ux-radiogroup',
    		      fieldLabel:'group1:',
    		      name:'group1',
    		      horizontal:true,
    		      radios:[{
    		                 value:1,
    		                 boxLabel:'box 1',
    		                 listeners:{
    			          'check':function(r,c){
    			           alert(r.boxLabel+": "+(c?"checked":"unchecked"));
    			     }
    			   }
    		       }, {
    			value:2,
    			boxLabel:'box 2',
    			checked:true
    		      }]
    	            },browsepanel
    	         ],
                     buttons: [{
                            text: 'Ok',
                            handler: function(){
                                var values=mywin.getComponent(0).getForm().getValues();
    			alert("values:"+Ext.encode(values));
                            }
    	        },{
    		text: 'Cancel',
    		tooltip: 'Cancel this operation',
    		handler: function(){
    		                	}
    		     }]
    				
    		}]
    	});
            mywin.show(this);
    Thanks very much for your help

    Dave

  7. #27
    Sencha User loeppky's Avatar
    Join Date
    May 2007
    Location
    Seattle, WA
    Posts
    230
    Vote Rating
    0
    loeppky is on a distinguished road

      0  

    Default


    4him and mankz: thanks for discovering this issue and for providing a work around. I'm in the middle of a project at the moment, but when it is done in a couple of weeks, I'll look into this more and publish your fix.

  8. #28
    Sencha User loeppky's Avatar
    Join Date
    May 2007
    Location
    Seattle, WA
    Posts
    230
    Vote Rating
    0
    loeppky is on a distinguished road

      0  

    Default


    dddu88: that is very odd, as buttonSelector is defined within the parent class (Ext.Button). Anyways, I won't be able to look into this for a couple of weeks, because I'm in the middle of a project that's got to ship soon. I'll be sure to look into it more afterwards, although feel free to poke around on your own. Maybe someone else on the forum will be able to help as well...

  9. #29
    dddu88
    Guest

    Default


    Finally, I got it working by extending BrowseButton from BoxButton instead of Ext.Button.

    Thanks very much for your nice work.

    Dave

  10. #30
    Ext JS Premium Member
    Join Date
    Mar 2008
    Posts
    149
    Vote Rating
    0
    lagos.tout is on a distinguished road

      0  

    Default Hidden button renders too small to hit.

    Hidden button renders too small to hit.


    Hi,

    When using browsebutton, I've found that I have to manually set the width and height of the button with

    Ext.fly(Ext.query('#artistImage_selectFile_id div')[0]).applyStyles('height: 18px; width: 42px;');

    (or whatever dimensions work best) if the button resides in a FormPanel that was rendered with config setting 'hidden: true'. If I don't do this, the hidden button is set to a size that is too small to hit (only a couple of pixels in width and height).

    I'm curious to know if anyone else has encountered this. btw I'm using FF 2.0.0.13 on xp.

    Thanks.

    LT