How to Properly Setup a Form Component?

I’m confused on how to properly use Form Components.

https://wiki.servoy.com/display/DOCS/Form+Component

The wiki article talks about the implementation via code, but I’m curious more about how this works UX wise.

WHAT I WANT TO DO
Create my own ‘components’, just like the built-in Servoy ones. Like a Drop Down or a Badge. But I believe this is beyond the scope of Servoy.

As the wiki says,

Form Component in the Solution Explorer Tree is a special contained form used for simplified design and runtime optimization for the NGClient. The same behavior can be achieved via tabless tabpanel, but form component has optimized display because all elements are part of the same form, taking away the overhead of tabpanel and loading of another form.

So, it’s more that it’s a form that is embedded into another form. I assume the concept is to like, have a small collection of Servoy Components in this one, such that it can be reused?

What confuses me is, how do I actually change the values of the elements within the form component? And how or where do I set the onAction events?

For Example;

If I have a button in a Form Component, how do I set it’s onClick event? Is it on the form it’ll be embedded in, like within an onShow or onLoad event?

Also, how exactly do I display the Form Component? I assume by the FormComponentContainer right? But what exactly does List FormComponent Container do differently?

john1598360627:
I’m confused on how to properly use Form Components.

https://wiki.servoy.com/display/DOCS/Form+Component

The wiki article talks about the implementation via code, but I’m curious more about how this works UX wise.

WHAT I WANT TO DO
Create my own ‘components’, just like the built-in Servoy ones. Like a Drop Down or a Badge. But I believe this is beyond the scope of Servoy.

If you want to actually creating really components, then you need to make angular components, so something like
https://github.com/Servoy/bootstrapcomp … rc/textbox

as our bootstrap textbox example.
But this is not in Servoy development but development for Servoy to enhance the things you can do in Servoy.

john1598360627:
As the wiki says,

Form Component in the Solution Explorer Tree is a special contained form used for simplified design and runtime optimization for the NGClient. The same behavior can be achieved via tabless tabpanel, but form component has optimized display because all elements are part of the same form, taking away the overhead of tabpanel and loading of another form.

So, it’s more that it’s a form that is embedded into another form. I assume the concept is to like, have a small collection of Servoy Components in this one, such that it can be reused?

yes a form component is a piece of design that can have a few servoy components (like a boostrap label and a bootstrap textbox) together so you can drop it as one thing.

if you drop it then it is part of the form where you drop it on. (you drop it through formcomponent container)

john1598360627:
What confuses me is, how do I actually change the values of the elements within the form component? And how or where do I set the onAction events?

For Example;

If I have a button in a Form Component, how do I set it’s onClick event? Is it on the form it’ll be embedded in, like within an onShow or onLoad event?

like normal a normal button that you would drop on the form, you just select the component that is inside the formcomponent (it must have a name)
then you can attach the onclick event of that embedded button to a function of the form where you placed that formcomponent it (through a form component container)

john1598360627:
Also, how exactly do I display the Form Component? I assume by the FormComponentContainer right? But what exactly does List FormComponent Container do differently?

a FCC adds the form as 1 thing so if the FC would have 1 label and 1 button you drop 1 label and 1 button on your target form, and you get exactly that
the LFC is a repeater of that, so you can reference a foundset to it. an then based on how many rows are in the foundset you get the label and the button repeated (like a table)

Ahhh ok ok thank you for explaining!

Hmmm, so what is the advantage of using a Form Component over say making a Template and just copy and pasting that template all over the place?

Hm, do Form Components work like Form Extension? Like does updating a Form Component update every instance of the Form Component that appears?

yes a form component can be updated (like adding a new component, setting some property) an that will be reflected on all forms that use that.
a template is a 1 time copy.

jcompagner:
yes a form component can be updated (like adding a new component, setting some property) an that will be reflected on all forms that use that.
a template is a 1 time copy.

Okay, sounds great! I’ll have to mess around with it to learn how to use it.