If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Zmey
Posts: 1,510
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: Application menu unavailable twice after Sheet closed

Yes, but when the sheet is closed it will not be destroyed. Can you please suggest how to destroy it in QML?


Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Developer
AlexXF
Posts: 323
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha
My Carrier: Vodafone CZ

Re: Application menu unavailable twice after Sheet closed

In current release problem is - Sheet destroyed after close (in Application Menu object).

Please use plain text.
Developer
ekke
Posts: 1,439
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Application menu unavailable twice after Sheet closed


Zmey wrote:

Yes, but when the sheet is closed it will not be destroyed. Can you please suggest how to destroy it in QML?


recently learned this ;-)

 

x.destroy()

 

from QML did it

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
AlexXF
Posts: 323
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha
My Carrier: Vodafone CZ

Re: Application menu unavailable twice after Sheet closed

Can you post QML sample code + signal processing for new sheet created?
Please use plain text.
Developer
jasoncheung
Posts: 67
Registered: ‎09-01-2012
My Device: Dev Alpha
My Carrier: Bell

Re: Application menu unavailable twice after Sheet closed

Thank goodness I found this thread.

 

I thought I was going insane wondering why my application would act on weird after closing the sheet that I opened from the Applicaiton menu......

 

sigh.

Please use plain text.
New Developer
Jack00513
Posts: 8
Registered: ‎11-12-2012
My Device: 9000
My Carrier: Simulator

Re: Application menu unavailable twice after Sheet closed

tks!

Please use plain text.
Developer
jasoncheung
Posts: 67
Registered: ‎09-01-2012
My Device: Dev Alpha
My Carrier: Bell

Re: Application menu unavailable twice after Sheet closed

I don't think calling .destroy() in QML is valid for a sheet.

It compiles and runs and all, but I don't think it actually does anything.  I ran my app through a profiler, and the memory keeps on piling up with the sheets....

 

We better not be punished for this since this is an OS bug, as we are creating a workaround to make sheets work with the Application Menu....

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Application menu unavailable twice after Sheet closed

An alternative workaround is to have the Menu trigger a singleShot QTimer with a delay of 350ms or more (probably 500ms to be safe), and have the onTimeout of the QTimer do the actual sheet.open() call.

It appears the issue may be related to having the Menu onscreen at the time the sheet arrives... maybe a conflict in animations? Anyway, the delay seems to be long enough to prevent that, and you can repeatedly open/close the same Sheet if you do this.

Of course, this only helps those who want to do this approach in the very short term, since there's a new release coming which apparently fixes this.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
HorizonXP
Posts: 133
Registered: ‎03-28-2011
My Device: BlackBerry 9900 & PlayBook
My Carrier: Bell

Re: Application menu unavailable twice after Sheet closed

Just want to chime in to say that I appear to have fallen victim to this bug, but from a different approach.

 

In my app, I have a Sheet that instantiate in QML via createObject(). I have a signal that gets sent up to my Python code to validate the input on the Sheet, which fires a signal back to the sheet telling it what inputs are valid or not. The sheet then pops up a SystemToast alerting the user to the problem.

 

After closing and reopening the sheet, the signal gets sent once but results in 2 SystemToasts. If I close it and reopen again, I get 3 of them.

 

Modifying my code to destroy the object causes my code to crash when I call sheet.close(). I could rearchitect to work around this, but my code to insert data also depends on this. It would result in multiple rows being added. Furthermore, I'd really like to keep this architecture as it results in more modular code. 


Founder of Pulsecode Inc. and taab
Authomator - Two-factor authentication codes on BlackBerry 10 - http://www.xitijpatel.com/ - Follow @xitijpatel
Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Application menu unavailable twice after Sheet closed

Are you explicitly connecting something in the dynamic objects to a signal/slot elsewhere, as in signalName.connect(functionInDynamicObject)?

If so, you might need an explicit disconnect() too. Otherwise it might be something about the way you're getting those signals into the Sheets in the first place... is something still being left around after the sheet is closed, resulting in the closed-but-not-destroyed one participating in the same interactions somehow?

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.