Can I make a reusable Panel clone?

GuyBooth

Active Member
Licensed User
Longtime User
I have a Custom List View and want to make a copy of one of the "Items", which is a panel with a few label views, and then add it to the end of the list.
Making a copy is straightforward, but as soon as I try to add it back to the CLV of course I get the error "The specified Child already has a parent. You must call RemoveView() ...." etc.
I understand why this happens. But is there a way to make a clone - a complete new instance - of the panel and its views that I can then add back in?
Any pointers appreciated...
 

GuyBooth

Active Member
Licensed User
Longtime User
I ended up copying the data, creating a new CustomListView item and copying the data to it, then deleting the original item. I was able to adapt some existing code in the app to multiple functions, so in the end it wasn't too bad.
 
Upvote 0

Rick A.

Member
Licensed User
Longtime User
As we can't visually design a panel with controls, load it as a factory template, and create new instances of it in a such way that it could be used as "new lines" (ListItems) of a CustomListView (it would be beautiful, by the way), should be great at least to add a new feature to the Abstract Designer, a "View as Source", this way we could see the equivalent code of that design done, copy/paste, and optionally make adjustments in the code being made to create such factory code.

Made a request. https://www.b4x.com/android/forum/threads/abstract-designer-view-as-source.57551/
 
Last edited:
Upvote 0
Top