Multibutton selected

25 views
Skip to first unread message

howud...@gmail.com

unread,
Oct 6, 2016, 7:53:55 PM10/6/16
to CodenameOne Discussions
I have a list of MultiButtons added to a container with BoxLayoutY with the container in the form at BorderLayout.WEST
When a user taps on one of the multibuttons it fills in the details in the container in BorderLayout.CENTER
When the user taps, I pass in the MultiButton to the event and call setSlected(true), however the MultiButton doesn't seem to provide any information that it is selected.  The pressed state highlights the mb, but selected doesn't.  How can I get the multibutton that is "selected" draw seleted?

Shai Almog

unread,
Oct 6, 2016, 9:41:12 PM10/6/16
to CodenameOne Discussions, howud...@gmail.com
Set selected is designed for the checkbox/radio button mode of the multi-button. It has no effect when using the multi button "as is".

Peter Carlson

unread,
Oct 6, 2016, 9:53:51 PM10/6/16
to Shai Almog, CodenameOne Discussions

I have created many of my own multi buttons. What do I need to set for the selected state to look looked the pressed state in native theme?

Shai Almog

unread,
Oct 7, 2016, 10:03:41 PM10/7/16
to CodenameOne Discussions, shai....@gmail.com, howud...@gmail.com
That's a toggle button in Codename One and it's not inherently supported within MultiButton.

You can create your own lead component whose lead is a ToggleButton and work with that.

howud...@gmail.com

unread,
Oct 7, 2016, 10:24:58 PM10/7/16
to CodenameOne Discussions, shai....@gmail.com, howud...@gmail.com

You can create your own lead component whose lead is a ToggleButton and work with that.

Beautiful that worked like a charm 
Reply all
Reply to author
Forward
0 new messages