I have found an issue with the dialogs module and I'm not sure why @omz you might be able to explain.
The code here is a simple example of it.
# coding: utf-8
import ui
import dialogs
def dia_test(sender):
dialogs.form_dialog(title='Test',fields=[{'type':'text','title':'Some Title'}])
class testtv (object):
def tableview_did_select(self, tableview, section, row):
dia_test(None)
def tableview_number_of_rows(self, tv, s):
return 1
def tableview_cell_for_row(self, tv, s, r):
cell = ui.TableViewCell('default')
cell.text_label.text = 'Test'
cell.selectable = True
return cell
view = ui.TableView()
dbo = testtv()
view.data_source = dbo
view.delegate = dbo
view.right_button_items = [ui.ButtonItem(title='Press me!', action=dia_test)]
view.present()
When I click the bar button item press me the form dialog appears ok and I can click done and it dismisses happily.
If I call the same function from the tableview_did_select The form dialog appears but when I click done I get the following error
Traceback (most recent call last):
File "/var/mobile/Containers/Bundle/Application/CEBD1281-94B0-4EEC-BA60-D9599A5873CD/Pythonista.app/Frameworks/PythonistaKit.framework/pylib/site-packages/dialogs.py", line 365, in done_action
self.container_view.close()
AttributeError: 'NoneType' object has no attribute 'close
I hope all this code has formatted happily I'm posting this from my mobile and the form isn't that great.