Get Value from Dependency

Hello,

Initial problem is displaying an arbitrary set of columns with a two rows of radio buttons for a client to select the columns.

I tried to use Data Grid and Horizontal Repeating Panel. After getting the information to display correctly on the Horizontal Repeating Panel dependency, as shown below, I now need to get the radio button values selected.

Issue statement:

How do I return values from a dependency (form dependency) to my main program (not just display values)

Thank you.

Hi @Truth and welcome to the forum!

Here is a simple clone that shows two ways you can exchange values between the template and the RepeatingPanel. This uses a combination of set_event_handler and self.parent.raise_event().

If you haven’t already, can I suggest taking a look at the News Aggregator tutorial? In particular, Chapter 7 uses this same pattern and may be useful :slight_smile:

Anvil Docs | RepeatingPanels

Hi Bridget!

Thank you for the response!

For the data grid approach to solve this problem:

Unfortunately the news aggregator example does not do what I need it to because I need an arbitrary number of buttons, not a drag and dropped button. That means I would need to set repeating_panel.items = (button object)

Is there a way to do this?

For the horizontal repeating panel approach:

Does self.parent.raise_event() work on a dependency such as described here?

https://anvil.works/forum/t/repeating-panel-horizontally/3127

Thank you for the help!

Sincerely,

Justin

If I remember correctly, items is intended to contain data, not components.

If you’re looking for a place to add runtime-created buttons, look to the repeating panel itself, or rather, its item_template. As a container, it has methods for adding components at run-time. Each instance of your item_template class can maintain (add/remove) its own list of components (e.g., buttons).

Perfect. I will look into it. Thank you!