Getting None Type Not iterable at update_binding.py:4 - when trying to add a form to application

What I’m trying to do:

I created a new form using the custom html template. I have been fighting with getting spacing correct when placing left side bar along side a RepeatingPanel display of newly create responses from an Assistant AI api. I have the same form elements working in a previous form but in this case when I initialize the form it fails to load with the message :
TypeError: 'NoneType' object is not iterable. Did you initialise all data binding sources before initialising this component?

  • at update_binding.py:4

I have all the same code from the previous form in this form, the data bindings are set as they were in the previous form. I instantiate the new form using the same procedure i use for the 6 other forms in this application. Is there any way to get more information regarding where this error is coming from? Is there a traceback verbose setting?

Is there any other way to test the form? The repeating panels have a text area an ID number and text box for showing a line of text with each repeating panel filled – those are set using the items array and i have the same form elements (copied) from the previous version with the only difference being the use of the HTML form instead of the blank form element –

What I’ve tried and what’s not working:
Checking all of the existing form elements initialization from code and the repeating panel is created in a separate form element but that has worked across several versions of trying to get the HTML to look and work correctly –

Code Sample:

# this is a formatted code snippet.
# paste your code between ``` 

Here is the way the form is created and added to the project 
self.agentchat_form = chat_upgrade()
self.agentchat_form.server = anvil.server
self.agentchat_form.globalhash = self.globalhash
self.globalhash.update({'current_selected_site':self.current_selected_site.text})
self.page_2_panel.clear()
self.page_2_panel.add_component(self.agentchat_form)

Thank you –
Clone link:
share a copy of your app

Have you looked at all the components and their properties looking for any data bindings that might have snuck in? The error message is triggered by an error in a data binding, specifically when you have something like self.item['foo']['bar'] and self.item['foo'] is None. Look inside your repeating panel row template for data bindings there, too.

1 Like

If you have the same form elements working in a different form, could you duplicate that form and then copy over the necessary HTML adjustments?

Or, alternatively, can you revert to a previous version of the current form that did work, and then go from there?

Hi Jshaffstall – I looked at that portion very closely. Maybe i will take out the binding and then try to reinsert that if the form will present – Thank you for the help. I put a lot of hours in the structure of the two blocks of html made and would like not to rebuild it all again.

The original working form is messed up – it slides to the left when I add text to an input box on the right. It’s just classic html errors – but the repeating panel and the other structure of vertical labels and drop down boxes are functional and work stand alone – So worst case is I just start over.

Thank you for your comment.

JM

That worked. I am was able to bring the form up with text only in the locations that are later filled from the item list.

One last question, I cannot get the space on both sides of the form to go away. The margins on the right and left are not the same as in the designer. See the image below and notice how the form is sandwiched inside of the large margin-left and margin-right – I have highlighted the margins using the browser tools.

Thank you for any further help,

JM