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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 230
Registered: ‎01-12-2013
My Device: z30
My Carrier: Mobile Vikings
Accepted Solution

Click on disabled ActionItem

Hey Developers

 

The UI guidelines say

Disable a "Submit" action until users enter all of the required data. If users try to select a disabled "Submit" action, display an inline message or a toast to identify what's missing.

So far on disabling the Submit action. But as the guidelines indicate, we should show a message when a user tries to tap on the disabled button/actionitem. How can I catch an event on a disabled button or ActionItem? I went down on the API but could not find anything.

 

Does someone has an idea in accomplishing this?

 

Thanks in advance

______________________________________________________
BB10-OAuth: GitHub
Developer
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30
My Carrier: T-Mobile

Re: Click on disabled ActionItem

I don't think they mean actually disabling the button/action (ie enabled: false) rather keeping it enabled (ie enabled: true) but "disabling" by not allowing the user to continue by posting the dialog. Psuedo code:

 

if all fields filled)

 { //run}

else {//show error message}

 

 

Because I don't think its possible to retrieve an instance of a user pressing a diabled button/action.

---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan
Developer
Posts: 230
Registered: ‎01-12-2013
My Device: z30
My Carrier: Mobile Vikings

Re: Click on disabled ActionItem

Yes I don't think that's possible either. But actually I think it's quite logically to disable the button because you let the user visually know, when he gave the right information. The guidelines are not always very clear...

______________________________________________________
BB10-OAuth: GitHub
Developer
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30
My Carrier: T-Mobile

Re: Click on disabled ActionItem

Are you saying my suggestion is not possible...?  Why not have:

 

actions: [
ActionItem {
            id: action1
            title: "myActionTitle"
            imageSource: "asset:///myImageName"
            ActionBar.placement: ActionBarPlacement.OnBar
            onTriggered{
              if (textfield1.text == "" || textfield2.text == "" ...){
                   //open dialog saying whatever fields are empty
myDialog.open(); } else{ //run your code for the action } ]

 Or yes you could disable the Action until all fields are filled with something.  Think both would be effective.

---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan
Highlighted
Developer
Posts: 230
Registered: ‎01-12-2013
My Device: z30
My Carrier: Mobile Vikings

Re: Click on disabled ActionItem

No I meant that it's not possible to catch the event on a disabled actionitem.

______________________________________________________
BB10-OAuth: GitHub