Titanium Community Questions & Answer Archive

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

SplitView Popup hide ? on click

Hi All,

does anyone know what to call to close the default splitview popover.

By close I mean the same way it closes when you tap away from the popover.

I am trying to make sure the popover is closed before I slide in a modal window.

I have tried everything I can think of (even looked at the source to try figure out how it does it)

splitView.hide() //does nothing

splitView.hide(animated:true) //does nothing

splitView.masterView.close //closes the window but not the popover

masterWindow.close //closes the window not the popover

it just doesnt seem to behave like other popovers

thanks in advance

— asked July 31st 2010 by Richie Mortimer
  • close
  • popover
  • splitview
3 Comments
  • Did you solve this problem? I'm trying to figure it out as well. How do we get access to the popover from a splitview?

    — commented August 2nd 2010 by Christy Thomas
  • Hi all,
    First, thanks to Appcelerator for its nice Titanium tool, and everybody active here for their useful help.
    Second, same issue as everybody here and there!
    I tried also a lot of things and the only result possible was to hide the content of the dynamic popover, but not the popover.
    Is somebody was able to success?
    Do that issue will be fixed soon? Or do we have to find a workaround to provide a better user experience than we have today with this specific case (Portrait mode and SplitWindow).

    — commented September 30th 2010 by David Muller
  • Obviously this feature is missing as of this writing.

    The good people at Titanium seem to fix this right now if I read this correctly):
    http://goo.gl/TrCxE

    This method splitView.setMasterPopupVisible(false) seems to be implemented in the 1.6.
    At least I tried it and it didn't work for me in the current 1.52.

    Actually this issue is quite a showstopper, so I hope this gets fixed soon.

    — commented February 11th 2011 by Dirk Krause

13 Answers

  • The following is working for me:

    splitView.setMasterPopupVisible(true);
    splitView.setMasterPopupVisible(false);
    

    Setting it to true, and then to false seems to trigger making the master popup hide every time!

    — answered May 11th 2011 by Marc Kurtz
    permalink
    0 Comments
  • try this:

    popover.hide({animated:true});
    

    keep in mind that popover is this:
    http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.iPad.Popover-object

    and not the splitview

    — answered July 31st 2010 by Dan Tamas
    permalink
    0 Comments
  • Hi Daniel

    sorry was a typo in my original post i have tried that

    you are correct in saying popover is not splitView, but I had to explain it somehow. Also I do believe that titanium utilizes the popover functionality for the split view (though I may be wrong).

    My issue is that i need to figure out how to make sure the splitView (popover masterView) is closed when I click a button. overwise it stays open and obscures my modal window

    — answered July 31st 2010 by Richie Mortimer
    permalink
    0 Comments
  • mmm, you want when the iPad is in portrait mode to hide the masterView I think.

    I'm not sure, this doesn't work ?

    the_split_view.masterView.hide({animated:true});
    
    — answered July 31st 2010 by Dan Tamas
    permalink
    0 Comments
  • Yes thats exactly what i want to do.

    if in portrait and the masterView is visible, then hide the masterView before opening my modal window

    unfortunately that snippet doesnt work either

    and simply doing splitView.close(); kills the app when i try to splitView.open(). (not sure why perhaps a bug in my code)

    — answered July 31st 2010 by Richie Mortimer
    permalink
    0 Comments
  • The splitview cannot be closed.
    Ok, try this ( it's dirty :) )

    put a Titanium.API.info when you click the button( nothing else ) and try to log the parent of the masterView
    I suppose with the previous code, the popover was there but the content hides.

    try to detect if the masterView has a parent, and what it is.
    if it's a popover, give it a hide :)

    click event

    Titanium.API.info(masterView.parent);
    

    should work , let me know, I'm curious

    — answered July 31st 2010 by Dan Tamas
    permalink
    0 Comments
  • Nothing mate [INFO] <null>

    tried various others masterNav ect all null.

    its strange because there must be someway to close it, or the normal closure wouldnt work. just need to find the right piece of code :P

    — answered July 31st 2010 by Richie Mortimer
    permalink
    0 Comments
  • Last idea :)

    
    split_view.popoverView.hide({animated:true});
    
    — answered July 31st 2010 by Dan Tamas
    permalink
    0 Comments
  • :)

    I tried that one mate, along with a few variants splitView.popover, splitView.popOver

    thanks anyways, I will keep trying and if i find something ill let you know

    (im sure i posted this half hour ago….)

    — answered July 31st 2010 by Richie Mortimer
    permalink
    0 Comments
  • Does anyone have a solution for this yet? it seems the best I can do is hide the content in the popup

    — answered September 15th 2010 by dan bachelder
    permalink
    0 Comments
  • Calling:

    splitView.setMasterPopupVisible(false);

    only seemed to work for me the first time. The next time the code is run, it would not close the popup. (I tried calling it twice as suggested, but no luck)

    — answered April 30th 2011 by Marc Kurtz
    permalink
    2 Comments
    • Aaron's hack works for me but you should see his code. The answer above is misleading. In his blog post he uses:

      SplitViewApp.splitView.setMasterPopupVisible(false);
      SplitViewApp.splitView.setMasterPopupVisible(true);'
      

      — commented April 30th 2011 by David Wilson
    • On second thought, reverse the order. Call with true first, then false. This should result in a lower risk of the hack breaking when Ti is updated.

      — commented April 30th 2011 by David Wilson
  • i had the same problema and this worked for me..
    thanks

    — answered June 11th 2011 by Bruno Braga
    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.