• Appletrain

    @mikael, thank you, that took care of it. I had tried that, but I put it at the update function not the select function.

    posted in Pythonista read more
  • Appletrain

    @mikael, this is about as stripped out as I can make it

    def tableview_add(self):
                trxRec = {}
                result = {}      
               # trxRec = {'account': self.selected_account}
                result = bucks_dialog(trxRec)    # this works
            
        def tableview_update(self):
                result = {}
                trxRec = {}
               # trxRec = self.selected_item
                result = bucks_dialog(trxRec)    # this blows out - self.container_view changes to None
            
        def tableview_did_select(self, tv, section, row):
                self.tableview_update()
            
    def transaction_action(sender):    # sender is ui.button
        sender.tint_color = 'blue'
        ds.tableview_add()
    

    Bucks_dialog is a custom form_dialogs from dialogs

    Error is:

    Pythonista3/Documents/Projects/bucks/bucks_form.py", line 217, in trans_type_action
    self.container_view.name = segment_names[ind]
    AttributeError: 'NoneType' object has no attribute 'name'

    self.container_view is none (form_dialog)

    posted in Pythonista read more
  • Appletrain

    @mikael Thanks @mikael, doesn’t help. Same error, same place. What I can’t understand is why it works one place and not another. I stripped every thing out of the two functions so they are doing exactly the same thing. On blows up, the other does’t.

    posted in Pythonista read more
  • Appletrain

    I’ve written a custom input form sub-classed from input form dialog. It works fine stand alone. It also works fine when called from a button on my tableview form. When I call it from tableview select, it blows out. Somehow container_view becomes None. I’ve tried everything I can think of, including calling the button action. Any thoughts?

    posted in Pythonista read more
  • Appletrain

    Thank you all. @ui.in_backround solved it.

    posted in Pythonista read more
  • Appletrain

    I’m launching a standard dialog from tableview_did_select

    def tableview_did_select(self, tableview, section, row):
            self.selected_row = row
            self.selected_section = section
            print(dialogs.list_dialog('list dialog', items=['happy', 'days', 'are', 'here', 'again']))
    

    This always returns None!

    However, if it’s launched from a ui.ButtonItem on the same view it works properly and returns the selected item.

    def cancel_action(sender):     
        print(dialogs.list_dialog('list dialog', items=['happy', 'days', 'are', 'here', 'again']))    
        ui.end_editing()
        ds.container_view.close()
    

    This always returns the selected item

    Any suggestions on making tableview_did_select work?

    posted in Pythonista read more
  • Appletrain

    @cvp Thank you, that did it.

    posted in Pythonista read more
  • Appletrain

    It crashes Pythonista. It’s a switch on a simple test form. Does’t do anything. Tap the switch and pythonista locks up.

    posted in Pythonista read more
  • Appletrain

    [link text](link url)I hope someone can help on this.

    This works...

    def alert_action(sender):
        print('got here')
        #print(dialogs.alert('Change to inactive', 'Are you sure?', 'Ok'))
        
    input_frm['switch1'].action=alert_action
    

    This doesn’t...

    def alert_action(sender):
        print('got here')
        print(dialogs.alert('Change to inactive', 'Are you sure?', 'Ok'))
        
    input_frm['switch1'].action=alert_action
    

    and it locks up Pythonista

    I just can’t see what’s wrong.

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!