What I’m trying to do: Hey all, I have two tables > Employees & Agencies. Agencies has a few standard text columns and one column linking to the Employees table using the “Multiple Rows” linkage. I’ve added link field to the repeating panel and configured the data bindings, however, I have a couple of questions:
On a repeating panel - I cannot seem to get a list of the linked employees to display properly - does anyone have generic code they can share?
I would like to display the employees’ information on an alert popup when the user clicks on the respective employee link from the column - does anyone have generic code they can share?
For #2, you can pop up a form in an alert, so for this type of use-case I usually build a form that renders attributes you want to show the users, and takes a row as an argument. So you end up with something like:
my_form = EmployeeForm(self.item) # where self.item is an employee row
alert(my_form, large=True)
I can’t figure out how to bind the “selected_value” to the linked table column. I would do it manually with a stand alone function but there will be a ton of fields on the form and I wanted to avoid having to program each field in the function. I am receiving an error on submission.
I believe it will produce an object of type str, not of type list. The two might be interchangeable in TCL (see everything is a string), but this is Python, which has a stronger type system.
To get an actual list of individual strings, if that’s what you need, just pare it down to:
[ emp['last_name'] for emp in self.item['employees'] ]
Where you’re getting the second issue, it isn’t clear to me what you’re trying to accomplish.
I recommend starting a new Forum Topic, on that specific subject. That way, when the answer becomes evident, it won’t be buried under an unrelated topic. It will be easier for all the forum members and visitors to find.