2025 Feb 11 6:25 PM - edited 2025 Feb 11 6:27 PM
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?
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
61 | |
7 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.