Button Click Event to show and hide if clicked again

I have a repeating panel with 2 column panels inside it.

Panel 1 is a Summary - one line
Panel 2 is a Detail - whole record it is set as visible = False

Panel 1 has a button on it and when I click the button it makes Panel 2 visible

 def button_1_click(self, **event_args):
    """This method is called when the button is clicked"""
    self.column_panel_full.visible = True
    pass

How would I make it so if the button is clicked again it would hide the column panel again?

If you want a toggle, with booleans there’s an easy trick for it:

self.column_panel_full.visible = not self.column_panel_full.visible
3 Likes

Thanks again! Another one solved.