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
New Developer
Posts: 13
Registered: ‎12-28-2012
My Device: BB10 Dev Alpha
My Carrier: Simyo

NotificationDialog documentation error

The code snippet at the end of this page,  

https://developer.blackberry.com/cascades/documentation/device_comm/notifications/index.html

connects the signal buttonSelected , that doesn't exist for the NotificationDialog 

https://developer.blackberry.com/cascades/reference/bb__platform__notificationdialog.html#finished

 

I'm not sure if I'm missing something, but I think that it is an error on the documentation.  

Developer
Posts: 87
Registered: ‎07-23-2009
My Device: Z30
My Carrier: XL

Re: NotificationDialog documentation error

I think it should be buttonSelection not buttonSelected

New Developer
Posts: 13
Registered: ‎12-28-2012
My Device: BB10 Dev Alpha
My Carrier: Simyo

Re: NotificationDialog documentation error

I don't think so, buttonSelection is not a signal, but a function. 

Developer
Developer
Posts: 132
Registered: ‎08-24-2011
My Device: Z10 LE + Playbook
My Carrier: MTS Ukraine

Re: NotificationDialog documentation error

Noticed the same this. It has finished signal. So the connection will look like this

 

bool success = QObject::connect(pNotification,           

SIGNAL(finished(bb:Smiley Tonguelatform::NotificationResult::Type)),

this,

SLOT(onSelected(bb:Smiley Tonguelatform::NotificationResult::Type)));

 

But it will give us only result type, no pushed button. How did you resolve this?

 

Thanks! 

Thank you!
----------------------------
My Apps: Alchemy Game | Image Resizer | Jam! | Traffic Signs: USA | Radio Record
My Blog: http://bb10pro.com
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: NotificationDialog documentation error

[ Edited ]

There's a function to get the selected button:

https://developer.blackberry.com/cascades/reference/bb__platform__notificationdialog.html#buttonsele...

I think it can be called from finished() signal's handler.

 


Andrey Fidrya, @zmeyc on twitter
New Developer
Posts: 13
Registered: ‎12-28-2012
My Device: BB10 Dev Alpha
My Carrier: Simyo

Re: NotificationDialog documentation error

Use : 

QObject * QObject::sender () const 

inside your slot to get a pointer to the sender, and add the proper qobject_cast< Button* >( senderBtn ) , and you should get the pressed button. 

New Developer
Posts: 13
Registered: ‎12-28-2012
My Device: BB10 Dev Alpha
My Carrier: Simyo

Re: NotificationDialog documentation error

Ooops .. sorry, that is for the clicked() event, not for the finished() ..
Zmey gave you the right solution.
Developer
Developer
Posts: 132
Registered: ‎08-24-2011
My Device: Z10 LE + Playbook
My Carrier: MTS Ukraine

Re: NotificationDialog documentation error

Already managed. Thanks everyone. 

Thank you!
----------------------------
My Apps: Alchemy Game | Image Resizer | Jam! | Traffic Signs: USA | Radio Record
My Blog: http://bb10pro.com