Jump to content

Dialog Results


---
 Share

Recommended Posts

Hi, i have created a "dynamic" Dialog wich has as many lines and checkboxes in it as the report has keyworks.

Now i'm trying to get to the results. Is there a way to get all avalable results from a dialog instead of access them directly?

Link to comment
Share on other sites

i can get this from the "result" object:

gom.dialog.DialogResult ('checkbox0': False, 'checkbox1': False, 'checkbox2': False, 'checkbox3': False)

would it be possible to iterate over the results?

Link to comment
Share on other sites

  • 1 month later...

Please have a look at the attached solution. The trick is to convert the returned object into a string and then parse it into an array and (if needed) into a dictionary.

Please note that the values inside the dictionary are still strings, but converting to the desired types (boolean, integer, float) should be easy.

Example output from a dialog with 4 checkboxes:

RESULT (string) gom.dialog.DialogResult ('checkbox_0': True, 'checkbox_1': False, 'checkbox_2': True, 'checkbox_3': False)
'checkbox_0': True, 'checkbox_1': False, 'checkbox_2': True, 'checkbox_3': False
key: checkbox_0 val:  True
key: checkbox_1 val:  False
key: checkbox_2 val:  True
key: checkbox_3 val:  False
RESULT (dictionary) {'checkbox_0': 'True', 'checkbox_1': 'False', 'checkbox_2': 'True', 'checkbox_3': 'False'}
checkbox_0 True
checkbox_1 False
checkbox_2 True
checkbox_3 False

 

dialog_results.py

Link to comment
Share on other sites

Hi Christoph,
There is a simple solution. You can just use: 

Code:

RESULT.__args__[0]

Output:

{'checkbox': False, 'date': gom.Date (16, 6, 2023), 'elementname': '', 'input': 0.0}
Edited
Link to comment
Share on other sites

 Share

×
×
  • Create New...