ComboBox with SpanButton VS MultiButton as rendered multiline text

11 views
Skip to first unread message

shop.servic...@gmail.com

unread,
Apr 8, 2019, 9:55:02 AM4/8/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 Android 7+ & IOS 12+

Looking at developers guide example:
            Form hi = new Form("ComboBox", new BoxLayout(BoxLayout.Y_AXIS));
            ComboBox<Map<String, Object>> combo = new ComboBox<>(
                    createListEntry("A Game of Thrones",null, null)
            ,createListEntry("A Clash Of Kings", null, null)
            ,createListEntry("Replace Master Cylinder b: Replace both front calipers\n(must be done in pairs)", " c: Replace 1ft of\nbrake line d: Drain, fill and bleed brake fluid.", null)
            ,createListEntry("A Feast For Crows", null, null)
            ,createListEntry("A Dance With Dragons", null, null)
            ,createListEntry("The Winds of Winter", "2016 (please, please, please)", null)
            ,createListEntry("A Dream of Spring", "Ugh", null));
            combo.setRenderer(new GenericListCellRenderer<>(new MultiButton(), new MultiButton(),new MultiButton(), new MultiButton()));
            hi.add(combo);
            hi.show();

How to render comboBox list entries as multiline, both in the popup and combobox view?
SpanButton supports this, however GenericListCellRenderer does not render any text.

Thoughts?

Thanks in advance
Regards

Shai Almog

unread,
Apr 8, 2019, 11:47:00 PM4/8/19
to CodenameOne Discussions
Use a text area. Set it to editable false and use setUIID("Label"). SpanLabel is lead component and won't work well with a renderer.
Reply all
Reply to author
Forward
0 new messages