cancel
Showing results for 
Search instead for 
Did you mean: 

MDK - pageProxy getActionBar not working on Android

kevinbraun
Explorer
0 Kudos
152

I'm trying to control my Action Bar Item visibility through a rule, but am struggling on an Android device.  I've reproduced the issue in a simple test scenario below.

My test page has a Form Cell Simple Property.  In the OnValueChange event, I'm calling a rule.  In the rule, the issue that I'm running into is that on an Android device (Zebra TC51), calling clientAPI.getPageProxy().getActionBar() is failing.  It works on the webclient.

The OnValueChange event code is:

 

export default function TestChangeValueEventAndActionBar(clientAPI) {
    const bar = clientAPI.getPageProxy().getActionBar();
    if (typeof bar !== 'undefined') {
        alert ('bar good')
    }   
}

 

On the web client, I get the alert.  On the android device, I do not.

The other thing I've tried is accessing the properties directly:

 

    const bar2 = clientAPI.getPageProxy()._page._actionBar;
    if (typeof bar2 !== 'undefined') {
        alert ('bar2 good')
    } 
    const items = bar2._items;
    if (typeof items !== 'undefined') {
        alert ('items good')
    } 

 

In this case, on Andriod we get "bar2 good" but not the second alert.  On web, we get both.

My end goal is that I want to show/hide or enable/disable the Action Bar Item when a value is entered in the Simple Property.  The strategy is that I have a rule in the Visible property of the Action Bar Item that returns true or false, and then on the value change event I call the redraw() method.  But I can't do that if the getActionBar doesn't give me the action bar.

Any advice?

Accepted Solutions (1)

Accepted Solutions (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

The getActionBar method was added as part of the action bar redesign in MDK 24.11.0 which explains why the web is working and Android isn't.  Please upgrade your android client to MDK 24.11.2 and try again.

kevinbraun
Explorer
0 Kudos
Thank you, I should have thought of that. Confirmed working after upgrading to latest version.

Answers (0)