omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Dialogs, and Forms.

    Pythonista
    4
    4
    2782
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • AtomBombed
      AtomBombed last edited by

      Can anybody point me to how to make a successful form dialog popup using the dialogs module? I have had trouble with it, and there is very minimal documentation provided on the subject. I keep getting errors, no matter what I do...

      Phuket2 1 Reply Last reply Reply Quote 0
      • ccc
        ccc last edited by

        https://forum.omz-software.com/search/form_dialog

        1 Reply Last reply Reply Quote 0
        • omz
          omz last edited by

          @AtomBombed Could you post some code that you've tried, and what kind of errors you're getting?

          1 Reply Last reply Reply Quote 0
          • Phuket2
            Phuket2 @AtomBombed last edited by

            @AtomBombed , I hope the below helps. The variables are named long on purpose. But if you look at the dialogs doc with this example, I think it should be clear.

            import dialogs
            import datetime
            
            
            def show_list_dialog(title, items):
            	return dialogs.list_dialog(title = title, items = items)
            
            def show_form_dialog(title, fields):
            	return dialogs.form_dialog(title = title, fields = fields)
            
            
            if __name__ == '__main__':
            	lst = ['red', 'blue', 'orange', 'purple']
            	x = show_list_dialog(title = 'A List Dialog', items = lst)
            	print x
            	
            	form_list_of_dicts = []
            	
            	form_list_of_dicts.append(dict(type = 'text', title = 'First Name',
            	key = 'first', placeholder = 'Ole'))
            	
            	form_list_of_dicts.append(dict(type = 'text', title = 'Last Name',
            	key = 'last', placeholder = 'Zorn')) 
            	
            	form_list_of_dicts.append(dict(type = 'date', title = 'Date Of Birth',
            	key = 'DOB', value = datetime.date.today()))
            	
            	x = show_form_dialog(title = 'A Form Dialog', fields = form_list_of_dicts)
            	print x
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB Forums | Contributors