Databinding Question

There are just a few things to focus on to clear up your questions.

First, this line gets a reference to a row in the data table, where the ‘company_name’ field equals the selected value in the dropdown widget:

row=app_tables.table_0.get(company_name=self.drop_down_1.selected_value)

Then each of these lines just pick values from the specified columns in that row, and assign those values to the .text property of specified widget on the page. Think of row[‘item’] like a dictionary (it’s not - it’s an object which holds a references to values in the selected row, but the syntax works similarly):

    self.text_box_company_name.text=row['company_name']
    self.text_box_admin.text=row['admin']
    self.text_box_email.text=row['email']
    self.text_box_phone.text=row['phone']
    self.text_box_address.text=row['address']
    self.text_area_representatives.text=row['representatives']

Then these lines just set values in the specified columns of the selected row, to the string stored in the .text properties of the specified widgets:

      row['company_name']=self.text_box_company_name.text
      row['admin']=self.text_box_admin.text
      row['email']=self.text_box_email.text
      row['phone']=self.text_box_phone.text
      row['address']=self.text_box_address.text
      row['representatives']=self.text_area_representatives.text

Hopefully, that helps clarify your fundamental question.

1 Like