custom component generate model in builder

  • 2
  • Idea
  • Updated 4 weeks ago
  • Under Consideration
Is there a way that I can have a custom component that would add a model to the page's definition on the builder side?
Photo of Matt Sones

Matt Sones, Champion

  • 32,106 Points 20k badge 2x thumb

Posted 2 years ago

  • 2
Photo of Matt Sones

Matt Sones, Champion

  • 32,106 Points 20k badge 2x thumb
And ideally, update that model's definition if the relevant properties of the component were changed?
Photo of Zach McElrath

Zach McElrath, Employee

  • 53,702 Points 50k badge 2x thumb
There is not a supported method for doing this in your own custom component's code right now. I'll convert this to an Idea.
Photo of Matt Sones

Matt Sones, Champion

  • 32,106 Points 20k badge 2x thumb
I have custom components that always need their own model, so the easiest way to make that happen is to have the component's code dynamically generate the model. It saves the time of creating the model every time in the builder.
However, if any other components need to interact with the model, or if I want to add model actions or something, it becomes much more complicated.

I'm open to other solutions/ideas, but it seems like having the component automatically add and update a model on the builder side would be really nice.
Photo of Arne-Per Heurberg

Arne-Per Heurberg

  • 2,854 Points 2k badge 2x thumb
Any word on this? Ditto Matt that it would be super helpful