Disable repeating panel component ONLY when associated radio button is selected

Raise event does execute the event in each row, but in your case you’re calling the function when you add the event handler, and not allowing Anvil to call it when you raise the event. You want it without the parenthesis after self.enable_checkbox:

self.set_event_handler('x-enable_checkbox', self.enable_checkbox)

As is, though, that will just enable all the checkboxes when you click any radio button. If I understand what you originally posted, you want the checkbox that matches the radio button to be enabled, and all the others ones to be disabled. You need to pass information to the event telling it which radio button was clicked, something like:

def radio_button_1_clicked(self, **event_args):
    """This method is called when this radio button is selected""" 
    self.parent.raise_event_on_children('x-enable_checkbox', item=self.item)

And then in your event handling code, look at that parameter to see what you need to do:

  def enable_checkbox(self, item, **event_args):
    self.check_box_1.enabled = item == self.item
2 Likes