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

Web and WebWorks Development

Reply
Contributor
Lawrence_Liu
Posts: 29
Registered: ‎09-05-2012
My Device: BlackBerry Q10 Z10
My Carrier: China Mobile
Accepted Solution

Is only one button and only one call back could be defined for a toast using HTML5?

Dear All, I have read the toast related documents, and wondering that is only one button and only one call back could be defined for a toast using HTML5? I would like to display three buttons and defined three call back for my toast, is it possible? If it's not possible to use toast to do this, how could I do this using other approach? Your comment and suggestion would be very helpful. Thanks :smileywink: https://developer.blackberry.com/html5/apis/blackberry.ui.toast.html
Please use plain text.
Contributor
Lawrence_Liu
Posts: 29
Registered: ‎09-05-2012
My Device: BlackBerry Q10 Z10
My Carrier: China Mobile

I saw in the document that one button and one dismiss cal...

I saw in the document that one button and one dismiss call back could be defined, that's two.

 

But what about three call backs?

 

Thanks :smileywink:

Please use plain text.
BlackBerry Development Advisor (Retired)
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: I saw in the document that one button and one dismiss cal...

Toasts are really meant to be notifications style UI components. For that reason we provide a button if you would like some specific user acknoledgment. But they are not designed to be a modal style notification.

 

If you would like to display multiple options for a user to select you can use a Dialog as per the following documention:

- https://developer.blackberry.com/html5/apis/blackberry.ui.dialog.html

 

You can take our HTML and CSS and make your own toast div and just show/hide as desired if ours is not flexible enough for you.

@erikjohnzon
erjohnson@blackberry.com
Please use plain text.
Contributor
Lawrence_Liu
Posts: 29
Registered: ‎09-05-2012
My Device: BlackBerry Q10 Z10
My Carrier: China Mobile

Re: I saw in the document that one button and one dismiss cal...

[ Edited ]

Dear erikjohnzon,

Thanks for your reply, does that means dialog is feasible for reminder pop up? for example, for a task management app, the task management app hook some background thread for the reminder, and when the due time for a specify task is coming, can we  pop up a dialog window to the user and promote three buttons to them, "Mark as done", "Postpone" and "Dismiss"?

Thanks again for your help :smileyhappy:

Please use plain text.
BlackBerry Development Advisor (Retired)
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: I saw in the document that one button and one dismiss cal...

[ Edited ]

That is a perfect function for a dialog. You can specify a three button dialog quite easily.

@erikjohnzon
erjohnson@blackberry.com
Please use plain text.
Contributor
Lawrence_Liu
Posts: 29
Registered: ‎09-05-2012
My Device: BlackBerry Q10 Z10
My Carrier: China Mobile

Re: I saw in the document that one button and one dismiss cal...

WOW, sounds great :smileyhappy:

 

Apprecaite for your great information

Please use plain text.
Contributor
Lawrence_Liu
Posts: 29
Registered: ‎09-05-2012
My Device: BlackBerry Q10 Z10
My Carrier: China Mobile

Re: I saw in the document that one button and one dismiss cal...

Dear,

Here comes the thing when I try on this field.

1. This UI diaglog can not be shown in the simulator, actually alter function is not working in the simulator, if I hook a callback containing alert, then the click will trigger nothing(the same code works fine on ripple).

Could anybody help to confirm whether it's normal or there's some issue with my BB10 simulator?

I am not sure whether this is a limitation by BB10 or it's a specify issue of my simulator.

2. According to the document you referred above, this dialog is not implemented on ripple, so I can not test and develop it on ripple simulator,

3. I don't have an develop alpha machine. So obviously I can not debug it on a physical machine.

So It's impossible for me to implement this dialog at this moment, this sounds really sad for me sine the 10K commitment award is end before we could get a BB10 physical machine,

Do you have any suggestion on this?

Thanks.
Please use plain text.