This document displays how to sort the Work Order Table by a specific column when a screen is loaded.

  1. In the Vision Window containing the work order table edit the InternalFrameActivated Event Handler.
  2. Add the following script:
def sortTable(sortColumn):
	table = system.gui.getParentWindow(event).getComponentForPath('Root Container.MES Work Order Table') #path to your MES Work Order Table
	gTable = table.getTable().getTable()
	gTable.getRowSorter().toggleSortOrder(sortColumn) # sortColumn sets which column index to sort on

def init():

system.util.invokeLater(init, 1500)

You should have this: 

You can edit the delay time, but ensure there is time for the Work Order table to load all the work orders.

In this example, we sorted on Due Date (Column 8)

  • No labels