Hello here again (with sincere apology for my last ‘bombed’ topic)
After signing for a free account and going through the tutorials, I am able to do something worth my while. I am still a newbie though so please understand if my question is a bit off the rails.
Here’s what I have been doing and where i am stuck. I created a server function to search a database (code below). Search is OK but it is displaying the found data in a client-side form that i am stuck.
Note: the function below to search server table; search_page is <class ‘dict’> that I pulled out from one search form.
def search_button_click(self, **event_args):
search_page = {}
submit_clicked = alert(
content= Userpage(item = search_page),
title="Search data",
large=True,
buttons=[("Submit", True), ("Cancel", False)],
)
lst_found = anvil.server.call('search_records', search_page)
Above line: called the server module function to search the table
The server returns a data row (sample below) that matches the search_page argument:
[[{'complex': 'Campinas Real Estate', 'street': '455 Campinas Street', 'country': 'Peru',
'remarks': '', 'email': 'cvh101@gmail.com', 'lease': 'none', 'town': 'Campinas', 'type2': 'farm'}], 1]
Note: lst_found is <class ‘list’>
To view the above data on the client side, I have a RepeatingPanel (‘found_panel’)
with item template linked to a form (ViewForm) with the same columns as the data table
in the server.
I tried the below function to load the lst_found but it doesn’t work. I get the error
that the form where it resides does not have the attribute ‘load_foundview’:
def load_foundview(self):
self.found_panel.items = lst_found```
Could I get any suggestion here how I could display the found data in a
form view with repeating panel?
Thank you.
PS: sorry for the ugly format; I am still learning how to post a neat one here…sigh.