1. #1
    Sencha User
    Join Date
    Feb 2014
    Posts
    102
    Vote Rating
    1
    Answers
    1
    prateek204 is on a distinguished road

      0  

    Default Unanswered: Sencha buttons remains focused and other problems with buttons ( windows phone 8 only

    Unanswered: Sencha buttons remains focused and other problems with buttons ( windows phone 8 only


    I'm using sencha touch 2.3.1 I have an app which works fine in android , IOS and even windows apps ( windows store apps ). In windows phone 8, I have the following issues:
    1) When I tap on a button, it gets focused and the event I assigned is triggered as expected and a new view is opened. But after closing the new view/returning to the page containing the button I tapped, i noticed that it remains tapped. I'm attaching a few screenshots for better understanding

    wp_ss_20140428_0001[1].png




    wp_ss_20140428_0002[1].png

    2) When a new window or view opens after clicking a button, if I tap on the new view on the places where there is button in the view below, the button gets tapped and the event of the button is fired. I used the following in my previous app to prevent this:

    Code:
    if(Ext.getCmp('center-report')){ 
                   return false;
                    }
    This code checks for the id ( center-report ) and it doesn't view of same report to open. But this works only if all the button's have same id. Also, I can still focus the button below. I ignored this till now, but it's really important to me now.
    PS: I'm using direct html code for the buttons.
    Here's a sample code:

    Code:
    '<table class="dashboardTable" border=0 cellpadding=1 cellspacing=1 width="100%">',
    '<tr><td width="80%" class="cardText" valign=top>View service revenue trends</td>
    <td width="20%" >{[this.buttonReport(2,"Revenue")]}</td></tr>',
    '<tr><td class="cardText" valign=top>View sales trends</td>
    <td>{[this.buttonReport(1,"Sales")]}</td></tr>',  
     '</table>' 
    
    buttonReport: function(id, name)    
    {            
    return Soham.object.Util.getConfirmButtonHtml('buttonReport0' + id, name, 'chart', id);
     },
    
    getConfirmButtonHtml: function(cls, text, icon, dataid) 
    {   
     var strHtml = '';    
    if (dataid) {        
    strHtml = '<div ref="' + dataid + '" class="x-button-normal x-button x-button-confirm x-iconalign-left ' + cls + '" ';    }
     else 
    {        
    strHtml = '<div class="x-button-normal x-button x-button-confirm x-iconalign-left ' + cls + '" ';    
    }    
    
    strHtml += 'ontouchstart="this.className = \'x-button-pressing x-button x-button-confirm x-iconalign-left ' + cls + '\'" ';   
    
    strHtml += 'onmousedown="this.className=\'x-button-pressing x-button x-button-confirm x-iconalign-left ' + cls + '\'" ';  
    
     strHtml += 'ontouchend="this.className=\'x-button-normal x-button x-button-confirm x-iconalign-left ' + cls + '\'" ';    
    
    strHtml += 'onmouseup="this.className=\'x-button-normal x-button x-button-confirm x-iconalign-left ' + cls + '\'">';   
    
    if (icon != '') 
    {        
    strHtml += '<span class="x-button-icon ' + icon + ' x-shown" style></span>';    
    }    
    if (text != '') {       
    strHtml += '<span style class="x-button-label">' + text + '</span>';    
    }    
    strHtml += '</div>';    
    return strHtml;
    },

    Is there anything I have to add to resolve this issue? Please help me resolve this as this is really important to me. Thanks

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,978
    Vote Rating
    132
    Answers
    335
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    Sounds similar to TOUCH-5423. Try the suggested workaround in the following post:
    http://www.sencha.com/forum/showthre...=1#post1036201
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

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

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

  3. #3
    Sencha User
    Join Date
    Feb 2014
    Posts
    102
    Vote Rating
    1
    Answers
    1
    prateek204 is on a distinguished road

      0  

    Default


    It's not the same issue. Also, I tried that workaround just incase. But it's not working.As for the second issue ( button remains focused once it is clicked, even after changing view ). I think it could be timing issue. Because when I tried debugging with weinre, its working properly. Though I still have the first issue.Also, note that this app is working fine in windows phone 8.1 and windows store ( tablet ).Please help me resolve this. Really important for me. Thanks

  4. #4
    Sencha User
    Join Date
    Feb 2014
    Posts
    102
    Vote Rating
    1
    Answers
    1
    prateek204 is on a distinguished road

      0  

    Default


    Can you please help me with this?Really important for me. I'm supposed to publish the app ASAP. Thanks

  5. #5
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,978
    Vote Rating
    132
    Answers
    335
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    You mentioned your first post that you were programming the buttons with straight html. Are you able to reproduce this issue using any of our examples? If so can you provide the url.
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

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

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

  6. #6
    Sencha User
    Join Date
    Feb 2014
    Posts
    102
    Vote Rating
    1
    Answers
    1
    prateek204 is on a distinguished road

      0  

    Default


    The straight html I mentioned was sencha's button html.
    Can you please go through the code I posted.
    And I'm unable to reproduce that issue with examples. I should not have copied sencha's html directly. It's a mistake and I can't go back now.
    Is there any way to resolve this without changing the code?
    Please go through it once.
    Thanks

  7. #7
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,978
    Vote Rating
    132
    Answers
    335
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    We really do not support using the framework in this way. I would strongly suggest redoing your code and using the framework as intended.
    With that said if a button remains selected it sounds like the pressedCls css is not being removed. This happens when the touchend event is detected on the onRelease method called.
    http://docs.sencha.com/touch/2.3.1/#...thod-onRelease
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

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

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

Thread Participants: 1

Tags for this Thread