Results 1 to 5 of 5

Thread: button tap not reacting when view gets added a 2nd time

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    28

    Default Answered: button tap not reacting when view gets added a 2nd time

    When an item from a list gets selected i execute the following lines of code.
    Code:
    this.details = Ext.create('EventManager.view.EventInfoView');
    this.getNavigationView().push(this.details);
    so i create a new view, and push it on a navigationview. In my controller i listen for a tap on an acceptEventButton which is inside newly created view.

    Code:
    Ext.define('EventManager.controller.eventController', {
    extend: 'Ext.app.Controller',
    config: {
        refs: {
            acceptEventButton: '#acceptEventButton'
        },
    
    
        control: {
            "acceptEventButton": {
                tap: 'onAcceptButtonTap'
            }
        }
    },
    ...
    The first time this view gets placed on the navigationview, the button tap works. When i hit the back button and push another view the button does nothing.

    I'd like to solve this by doing the logic as it is now. I'd rather not add the eventlisteners myself while i'm creating the view and then push it.

    Any ideas where this problem resides and how to fix?

  2. You should be able to add custom properties in the config panel.

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    Try using control without using ref, does that help you?
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  4. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    28

    Default

    changed it to

    Code:
    control: {
                "#acceptEventButton": {
                    tap: 'onAcceptButtonTap'
                }
            }
    but that doesn't solve the problem.

    i've seen code like button[action=acceptEvent] but i'm using the sencha architect and i can't add a action on a button. (http://www.sencha.com/forum/showthre...ies-goes-wrong)

  5. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    You should be able to add custom properties in the config panel.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  6. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    28

    Default

    with the new update for the sencha architect, i was able to add the action property on the button and by then using button[action=acceptEvent] in the controller i fixed this problem.

    Thx for the help.

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
  •