setting the pressed state of a Tab at instanciation

18 views
Skip to first unread message

shop.servic...@gmail.com

unread,
May 31, 2019, 6:21:44 PM5/31/19
to CodenameOne Discussions
If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA NetBeans 8.2
Desktop OS Windows 10 Pro
Simulator latest
Device PC, IOS, Android

I have a simple 2 element Tabs component and set the Tabs UIID to "mpiTabMetal" which has a foreground color for the unselected & selected states.

        ManageTimeSheetsTab = new Tabs(Component.TOP);
        ManageTimeSheetsTab.setTabUIID("mpiTabMetal");
        ManageTimeSheetsTab.setSelectedIndex(0, true);

The problem is tab index 0 is by default set initially in the Tabs class.
However the unselected state is being displayed when in fact the index is selected.

If I setSelectedIndex(1), both index tabs display the correct states 
Any subsequent selections display correctly. Only the initial instantiation does the problem surface.

Attached Image TabsInitialStateIndex_0_isSet.PNG shows the 2 tabs as "unselected"
Attached Image TabsInitialStateIndex_1_isSet.PNG shows the 2 tabs as "unselected"

Attached Image UnselectedThemeUIID.PNG shows the Unselected state.
Attached Image SelectedThemeUIID.PNG shows the Selected state.

Thanks in advance

Regards.
TabsInitialStateIndex_1_isSet.PNG
TabsInitialStateIndex_0_isSet.PNG
SelectedThemeUIID.PNG
UnselectedThemeUIID.PNG

Shai Almog

unread,
Jun 1, 2019, 1:00:26 AM6/1/19
to CodenameOne Discussions
Try using the version of the select method that accepts false. It's possible that the animation that you don't even see is interfering with this.

shop.servic...@gmail.com

unread,
Jun 1, 2019, 8:48:58 AM6/1/19
to CodenameOne Discussions
Applied following w/o results
ManageTimeSheetsTab.setSelectedIndex(0, false);
ManageTimeSheetsTab.setSelectedIndex(0);

Regards.

Shai Almog

unread,
Jun 1, 2019, 11:11:28 PM6/1/19
to CodenameOne Discussions
Can you isolate this to a test I case I can run?

shop.servic...@gmail.com

unread,
Jun 2, 2019, 9:30:33 AM6/2/19
to CodenameOne Discussions
I can't reproduce this issue in my test case.

That's disappointing.

Sorry to waste your time.

Will have to look at issue more closely.

Regards.
Reply all
Reply to author
Forward
0 new messages