com.codename1.ui.table.TableLayout (best practive to /Add delete a row dynamically)

10 views
Skip to first unread message

shop.servic...@gmail.com

unread,
Mar 6, 2019, 3:35:42 PM3/6/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, Android, IOS

I allow a user to add / delete rows of a table.

I have a TableLayout component with say 10 rows and 4 columns.

Best practice to delete the 4 columns from a row?

I see method "removeLayoutComponent(Component comp)"
I could individually call this method on the 4 components that make up the row I want deleted.

Is there a recommended approach?

PS. I do see a "addLayoutComponent" method, however I do not grasp how I would add a row at a specific location.

Thoughts?

Regards

Shai Almog

unread,
Mar 6, 2019, 9:54:17 PM3/6/19
to CodenameOne Discussions
Those are callbacks that the layout class receives from the parent container. Don't call them, they won't do what you expect but can harm your layout.
You can remove a component by invoking component.remove() or container.remove(cmp);

Reply all
Reply to author
Forward
0 new messages