[Free] CompCreator - create component dynamically

Extension to create/remove visible components dynamicly.

BLOCKS

Create:

2022-01-20_192218
Create a visible component in a container.
component: String or Component. component Class Name.
in: Component. where the new component to be created inside.

Remove

2022-01-20_123711
Remove the component from screen. if it's a container component, all his children will be removed.

Children

2022-01-21_195051
Return a list of component container's children.
This can be used for native component containers.
If the component is screen, or already removed, empty list will be returned.

Parent

2022-01-21_195055
Return parent (container) of a component

ListComponents


return list of same type in the container.
recursive:boolean. if true, it will return all component with same type. if false, only direct children returned.

SetValue

set the property of one specific component.
component: the component to set property. Not a String.
property: String. it can be the following 3 type:

  1. any in-build property name. even some property only show in Design pannel.
  2. "index", this tag will set the showing order of the component in his container.
  3. other string. this will give the component a user-defined property.

value: String. value of the tag.

GetValue

image

get the property's value of a component.

CreateWith

Create a batch of components with template. The first/outest component returned.
template: String. a json string descriping the structure of the components. (see below for how to get a template)
in : Component. where the new components to be created inside.
values: properties to replace the template.

HOW TO GET A TEMPLATE

a template is a json string like:

  1. At designer panel, you drag and drop the component, and make the layout as you wish, set all necessary properties.

  2. select the component (normally a container, but one single component is OK) in the Viewer or component tree, press Ctrl+C. (lools like this only work at MIT server, not Kodular)

  3. go to Blocks panel, drag out a "empty string" block, and presse Ctrl+V to paste the template inside the block.

  4. if we want to change the property in the template, replace the origin by {1}, {2}, {3}...
    for example, we want to change the Text and TextColor, we can change the template like this:

  5. feed the values socket with new property values

OnClick and OffClick

OnClick will bind a click event to a component like label, button, or even an arrangement.

With this method, no need to set the component clickable additional.

This one have high priority than native event.

DOWNLOAD LINK

[take me download website]

EXAMPLE

26 Likes
Wanted CompCreator "Create from Template" Tutorial
Create a text box with user input by clicking
UI card view for mobile
Display the sentences in screen
How do you create an application for the user to design the keyboard screen?
What is the best way of designing an appealing UI?
formatting output on screen
Buttons and while
Dynamic image component
Cannot find TextBox TextAlignment block
Set next table arrangment to visible to true
[HOWTO] 💬 Discourse API + App Inventor Implementation
Show checkboxes in my text box
Making a chat app
Change the CloudDb ProjectID at runtime
Change accent color
Text saved to check box
Corner Radius extension not working in Dynamic Components Extension
How do you make listview with multi column display?
How do you populate a layout using blocks?
Need help to create a calendar
:rainbow_flag: Flags of the World
How do you make it possible to work with another component through the component "any"?
Horizontal arrangement
Mass changing arrangements
Trouble Compiling my first app
How do I optimize my app? After fetching the data from api and display in ListView I experiencing lag
How do I create an image sprite within the Blocks code section (dynamically)?
Chatview with app inventor
Suggestions required for user approval
Custom fonts for listview
GestureDetect Extension (List and Swipe Images)
How to make a puzzle game with animation?
Question on copy sprites and canvas
Save image after click checkbox
Image Sprite Creation Through Code Blocks
Comment limiter le nombre d'écran (How do you limit the number of screens?)
How do you create a table (grid) to edit or delete items
How do you create a table (grid) to edit or delete items
Variable number of buttons depending on the number of links defined in an external list
Insert elements from the blocks section
Fomatted Listview
Error from Companion Expected a unique ID.....the ID is unique!
Create image automatically
Is it possible to a checkbox for every element in the listview
[FREE] TableViewer - fully style customized to show table data
MIT App Inventor and 100+ esp32, how could I do this?!
Dynamically add labels in for loop
Listwiew help me!
Is there no "of" component in MIT app inventor?
Add new buttons and sections dynamically
Display the sentences in screen
Problem with getting width after changing text
Setup tableviewer with customized format
[FREE | PAID] ClickZ - An extension to add click, long click and more actions to components!
Is it possible to list images in order in a horizontalarrangement?
[FREE] Image List Viewer Extension - A Fully Customizable List View with Title, Subtitle, Image and Checkbox
Updating a text box next to a slider(s) - multiple sliders each with their own text box
How do I read one line at a time of a Web request?
Make a new instance with a button
[FREE] 🔥 AllComp Extension: Get All Components using blocks
Label is missing FontBold setter block
Requesting Extension
Dynamic component- custom webview - scrollview can host only one child
:blue_square: Listview Examples with CompCreator
Buttons in listview
I miss certain blocks
Help with the DynamicComponents extension
I am having problem with finding some blocks
:blue_square: Create "Infinite" Pager
Creating a button list for microblocks micro:bit display
I'm having trouble on using Dynamic Components extension on my project
Difference between CompCreator and DynamicComponents?
About scrollable list
How can I make a history for a webview
Setting a color to a variable then changing it after does not work?
Listview attributes
Im trying to make a store app in App inventor using dynamic components nothing works HELP AS SOON AS POSSIBLE
Crash when opening app caused by tinydb
How do I make collapsible button like this
Added Button Stops Moving After Interacting with "Addbtn" or "Editbtn"
An issue with copying?
WHEN ANY KEY.CLICK only and not ALL buttons in the app
Text to be displayed on list item click
Not able to fully delete yusufcihan's Dynamic Component with Remove ID block
Wordle In A Day
How do you create a new checkbox every time you do something (press a button)?
Can anyone make an extension for me
Is there any extension so that my app automatically adds a new button and rename it?
Wanted CompCreator "Create from Template" Tutorial
Tinydb import data and split into variables
Set the background for Listviewer
How do you delete horizontal arrangement so fast?
How can I make a tab that we can add and remove?
Cómo puedo asignarle un botón a cada elemento de una lista
An easy way to create long lists?

good extension

Thanks for the color bug fix and the template option:+1:

now more confusing :upside_down_face:
component made sense...and prevents extension update to existing...

2 Likes

ok i will change back :joy: in one hour

edit: updated.

2 Likes

Does template work in kodular ?

I have a quick test, and found it's working in Kodular, but you need to write your template from scratch, since Kodular can not use CTRLC+CTRLV to get the template.

But what is button version and uuid

ok i forget to mention the $Name, $version, Uuid, $blocks are useless in this template, you can delete them, or just leave them there, they will be ignored anyway.

the $Components and $Type is needed. and other perperty name.

You can make extension for create from scratch , so that it will easy for kodular users

What do you mean? which function do you want to achieve?

Sorry, this is MIT App Inventor Community. It will get off topic if you talk about another builder in this forum. If you want to talk to the extension developer about Kodular, please private message him.

3 Likes

Ok sir @gordonlu310

1 Like

two methods (Children and Parent) added.

3 Likes

How can I jusfity all the sentences in order to be all lines in the same size. like this:


readerDisplayDynamic.aia (159.6 KB)

save all the buttons (or labels) to a list, then use for each item block and Any Button(Any Label) to set it's font size.

Would you please show me the block to know how to do that.

Osama asked for justifying, not for sizing

I noticed that for this app you have asked a lot of questions and every time you want a direct block.

Pls read some basic tutorial and do it by yourself. Already tell you how to do.

I am sorry to bother you Kevinkun.
Would you please give some more details to know the idea of how to justify the sentences

what's mean? TextAlignment for label? this is only for horizontally. there is no vertical alignment for label. You need to put label inside an arrangement and set arrangement's AlignVertical.