Capturing Form component attributes into a data structure

Hi @stefano.menci Thank you for the comprehensive answer and examples. I’ll re-read it once I get the hang of the basics. :slight_smile:

Let me isolate my question with something concrete. Let’ say we have this From design:

  • MyForm1 (contains):
    • card_component_enclosing_checkBoxes (contains):
      • chkBox_1DataBind :: checked → self.item[‘is_checked’]
      • chkBox_2DataBind :: checked → self.item[‘is_checked’]
      • chkBox_3DataBind :: checked → self.item[‘is_checked’]
      • chkBox_4DataBind :: checked → self.item[‘is_checked’]
      • chkBox_5DataBind :: checked → self.item[‘is_checked’]

I know there are various options, design-patterns, best-practices to inspect which chkBoxes are and aren’t checked. For instance, (forgetting about DataBinds for a moment – ignore them), this brute-force method can be done:

for component in self.card_component_enclosing_checkBoxes.get_components()
   if component.checked:
     [... execute code for a checked chkBox ...]
   else
     [... execute code for a not-checked chkBox ...]

I understand the above approach well.

So let’s go onto a second approach: DataBinds:

Using my design above, what is the correct expression to get to the self.item of each chkBox, so that I can inspect their respective dict(). Why? I keep getting blank dict() (i.e. { } ) back in my print() debug outputs when I execute print(someExpression); even though I was sure to tick chkBoxes.

What should someExpression be for each chkBox, based on the above design, so I don’t keep getting back: { }?

The fundamentals are what I’m after here because, apparently, I’m incorrectly indexing somewhere in my someExpression. :slight_smile:

Thank you!