Results 1 to 5 of 5

Thread: On Button Dubble tap/click, view pushing twice and resulting empty value in fields

  1. #1
    Sencha User
    Join Date
    Nov 2013
    Posts
    49
    Answers
    1

    Default Answered: On Button Dubble tap/click, view pushing twice and resulting empty value in fields

    I have 4 steps process in my application.
    Step 1: select item from list
    step 2: fill required details
    step3: verify & confirm
    step4 : result.

    On step2 after entering the details, if i double tap the next button then the next view(step3) pushing twice and showing with empty data. On single tap it's showing properly.

    please help me.

  2. There are a number of ways you could tackle this, here's an example that disables/enables the button.

    View:
    Code:
    Ext.define('MyApp.view.Main', {
        extend : 'Ext.navigation.View',
        xtype  : 'main',
    
    
        config : {
            items : [
                {
                    xtype  : 'container',
                    itemId : 'first-container',
                    items  : [
                        {
                            xtype  : 'button',
                            itemId : 'btn-push-view',
                            text   : 'Push View'
                        }
                    ]
                }
            ]
        }
    });
    Controller:
    Code:
    Ext.define('MyApp.controller.Main', {
        extend : 'Ext.app.Controller',
    
    
        config : {
            refs : {
                'pushViewButton' : 'main #btn-push-view',
                'mainView'       : 'main'
            },
    
    
            control : {
                pushViewButton : {
                    tap : 'onPushViewButtonTap'
                },
    
    
                'main > #first-container' : {
                    activate : 'onFirstContainerActivate'
                }
            }
        },
    
    
        onPushViewButtonTap : function(btn) {
            btn.disable();
    
    
            this.getMainView().push({
                xtype : 'component',
                html  : 'New view'
            });
        },
    
    
        onFirstContainerActivate : function() {
            this.getPushViewButton().enable();
        }
    });
    I didn't have any code samples from you to go on but this example uses a navigation view to push a new view on the stack when the button on the first view is tapped. On tap, the button is disabled to prevent further interaction. When the view containing the button is activated, the button is enabled again.

    If this example doesn't get you started on your way to a fix, please post more details and code for us to work from.

    I hope this helped you.

    Brice

  3. #2
    Sencha User bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    280
    Answers
    49

    Default

    There are a number of ways you could tackle this, here's an example that disables/enables the button.

    View:
    Code:
    Ext.define('MyApp.view.Main', {
        extend : 'Ext.navigation.View',
        xtype  : 'main',
    
    
        config : {
            items : [
                {
                    xtype  : 'container',
                    itemId : 'first-container',
                    items  : [
                        {
                            xtype  : 'button',
                            itemId : 'btn-push-view',
                            text   : 'Push View'
                        }
                    ]
                }
            ]
        }
    });
    Controller:
    Code:
    Ext.define('MyApp.controller.Main', {
        extend : 'Ext.app.Controller',
    
    
        config : {
            refs : {
                'pushViewButton' : 'main #btn-push-view',
                'mainView'       : 'main'
            },
    
    
            control : {
                pushViewButton : {
                    tap : 'onPushViewButtonTap'
                },
    
    
                'main > #first-container' : {
                    activate : 'onFirstContainerActivate'
                }
            }
        },
    
    
        onPushViewButtonTap : function(btn) {
            btn.disable();
    
    
            this.getMainView().push({
                xtype : 'component',
                html  : 'New view'
            });
        },
    
    
        onFirstContainerActivate : function() {
            this.getPushViewButton().enable();
        }
    });
    I didn't have any code samples from you to go on but this example uses a navigation view to push a new view on the stack when the button on the first view is tapped. On tap, the button is disabled to prevent further interaction. When the view containing the button is activated, the button is enabled again.

    If this example doesn't get you started on your way to a fix, please post more details and code for us to work from.

    I hope this helped you.

    Brice
    Brice Mason
    Front End Developer
    Modus Create

    @bricemason
    bricemason.com

    Sencha Touch Screencasts
    Vimeo - Sencha Touch Channel

    Github Projects:
    Sencha Cordova Builder enables the automatic creation, building, and running of PhoneGap (Cordova) projects with Sencha Touch.

    Am I Sencha Touch Ready? checks your system to determine what you need to do to start Sencha Touch development. If you're having trouble getting up and running, try this out.

    Sencha Tools Bridge allows Sencha SDK Tools to co-exist with Sencha Cmd on the same system.

  4. #3
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108
    Answers
    342

    Default

    You could also try adding a buffer to the listener. This will reduce the number of times the listener is called regardless of how many times the button is pressed.
    Discussed in the Events guide: http://docs.sencha.com/touch/2.3.1/#...stener-options
    Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services [email protected]

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  5. #4
    Sencha User bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    280
    Answers
    49

    Default

    I forget about the buffer option. I like that much better.

    Brice
    Brice Mason
    Front End Developer
    Modus Create

    @bricemason
    bricemason.com

    Sencha Touch Screencasts
    Vimeo - Sencha Touch Channel

    Github Projects:
    Sencha Cordova Builder enables the automatic creation, building, and running of PhoneGap (Cordova) projects with Sencha Touch.

    Am I Sencha Touch Ready? checks your system to determine what you need to do to start Sencha Touch development. If you're having trouble getting up and running, try this out.

    Sencha Tools Bridge allows Sencha SDK Tools to co-exist with Sencha Cmd on the same system.

  6. #5
    Sencha User
    Join Date
    Nov 2013
    Posts
    49
    Answers
    1

    Default Thank you, bricemason !!


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •