Tableview row selected... not working?
jessearwhite last edited by jessearwhite
I've tried both my own custom UI and other workflows and it looks like when you select a row in a table using the basic UI builder nothing happens, dumbed This down to just a simple table that shows an alert...
Is this already known? If so I couldn't find anything about it... Going to do this in UI/python now but it's overkill for the simplicity I actually need.
Got this working by adding the following to view appeared on the main view, it just saves the selected row into a variable for later (All I really needed):
import os import editor import workflow class MyTableViewDelegate (object): def tableview_did_select(self, tableview, section, row): # Called when a row was selected. workflow.set_variable('selected', tableview.data_source.tableview_cell_for_row(tableview, section, row).text_label.text) pass def tableview_did_deselect(self, tableview, section, row): # Called when a row was de-selected (in multiple selection mode). pass def tableview_title_for_delete_button(self, tableview, section, row): # Return the title for the 'swipe-to-***' button. return 'Delete' v = workflow.get_view() tableview = v['tableview1'] tableview.allows_selection = True handler = MyTableViewDelegate() tableview.delegate = handler