Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Remove leftNavButton/rightNavButton from Popover Crashes App

I have an popover with a leftNavButton, but in one moment a need remove this button, when i call:

mypopover.leftNavButton = null;

the App crashes!

what i'm do wrong?

This occurred in 1.4.1.1, 1.4.2 and 1.5.0 (04/11)

— asked November 5th 2010 by Adriano Paladini
  • crash
  • leftnavbutton
  • popover
  • remove
  • rightnavbutton
1 Comment
  • did you try it this way

    mypopover.setLeftNavButton(null);
    
    — commented November 7th 2010 by Aaron Saunders

3 Answers

  • Accepted Answer

    var emptyView = Titanium.UI.createView({});
    mypopover.leftNavButton = emptyView;
    

    Found this hack earlier when I wanted to show/hide an "Add" button in a table view when in editing mode.

    — answered December 10th 2010 by Tim Buckingham
    permalink
    3 Comments
    • I think Titanium team should make a sugar syntax like so:
      <pre>
      function setLeftNavButton(button) {

      if(button === null) {
          var emptyView = Titanium.UI.createView({});
          button = emptyView;
      }
      
      ... existing code ...
      

      }
      </pre>

      :)

      — commented June 22nd 2011 by Iftach Orr
    • nice trick with the empty view, thanks!

      — commented October 26th 2011 by Daniel Urstöger
    • Once I removed it, is there a way to get him back?

      — commented February 19th 2012 by Moshe Marciano
  • As of 11th January 2012, this no longer seems to be an issue. I use both ways to set "NavButton"'s to null and no obvious effects to the application.

    [INFO] Titanium SDK version: 1.7.3.v20111013094213
    
    app.windows._list.setLeftNavButton();
    app.windows._list.rightNavButton = null;
    
    — answered January 12th 2012 by freshteapot #
    permalink
    1 Comment
    • Here the same, too.

      — commented January 17th 2012 by Matthias Fliegner
  • Yes, i tried

    mypopover.setLeftNavButton(null);
    

    and

    mypopover.leftNavButton = null;
    

    but a crash occurred.

    — answered November 18th 2010 by Adriano Paladini
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.