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
Curahee
Posts: 224
Registered: ‎01-12-2013
My Device: z30
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

______________________________________________________
beRail: BlackBerry World - GitHub
Mobile Vikings: BlackBerry World - GitHub
Park in Brussels: BlackBerry World
Please use plain text.
Developer
bcs925
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30

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
Please use plain text.
Developer
Curahee
Posts: 224
Registered: ‎01-12-2013
My Device: z30

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...

______________________________________________________
beRail: BlackBerry World - GitHub
Mobile Vikings: BlackBerry World - GitHub
Park in Brussels: BlackBerry World
Please use plain text.
Developer
bcs925
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30

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
Please use plain text.
Developer
Curahee
Posts: 224
Registered: ‎01-12-2013
My Device: z30

Re: Click on disabled ActionItem

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

______________________________________________________
beRail: BlackBerry World - GitHub
Mobile Vikings: BlackBerry World - GitHub
Park in Brussels: BlackBerry World
Please use plain text.