Add BooleanField outside of section for a step with sections

I have a step in my editor which has 3 sections. Now I want to add a BooleanField to toggle the option to plot a certain thing. This BooleanField does not logically fit into any of the sections so I would like to add it outside of them. However when I try to write the parametrization for it I get an error in app definition. Is it possible to add a BooleanField outside of a section?

Below a screenshot of my code with error. The edit_gtl is the step, the shop_cpt_bool is the BooleanField I want to add and then the range_gefs is the first section on the page.

Hi Rutger,

As you may suspect: once you start using sections in the parametrization VIKTOR expects everything to be inside a Section. It’s a bit black and white: you can choose to use tabs and sections or not, but you cannot mix it. So, my advice to you is:

  • Use a Section for general settings, e.g.:
edit_gtl.general = Section("Algemene instellingen")
edit_gtl.general.show_cpt_bool = BooleanField()
edit_gtl.range_gefs = Section("Domein sonderingen")
<etc>
  • The other thing that you may be trying to do is show section based on the value of that BooleanField? For that, you can use the visibility argument on fields, and use the option to hide fields based on other fields

Hope this helps, let me know if it does (or does not)!

Hi,

That is what I was afraid of already. My BooleanField is used to select whether or not a certain line is plotted so I don’t use it to show a certain field. I will then use the workaround of adding a tab with general settings. Thanks for your reply :smiley: