Hello,
I have a customized ‘onMousePress’ extension function defined for a power table, in that function I validate that the cell is allowed to be selected based upon data in the selected cell as well as other criteria. My function is working properly as far as my tracing is concerned, but the Selected Row and Column are still sometimes being updated with the selected cell’s row/column value. Below is the customized portion of the method, and the trace output. I should NOT have gotten the PropertyChange events for TankOrderSelRow and TankOrderSelCol which are tied to the table SelectedRow and SelectedColumn properties.
I don’t understand what else could be changing this… Is there another way to problematically allow/disallow powertable cell selection?
rootContainer = self.parent
logger = rootContainer.getLog(method="onMousePress", lib="com.mwes.heartland", src="onMousePress", useStack=True)
currVal = self.getTankOrderSelValue( rowIndex, colIndex )
logger.info("Row %d, Col %d, Value %d, %s" % (rowIndex, colIndex, currVal, str(value)))
if currVal > 0 and currVal < 7:
logger.info("Clear From...")
self.clearTankOrderSelFrom ( rowIndex, colIndex )
self.updateProductTableFlags ( )
self.selectedRow = -1
self.selectedColumn = -1
elif not self.isValidTankOrderSel( rowIndex, colIndex ):
logger.info("Invalid...")
self.selectedRow = -1
self.selectedColumn = -1
else:
logger.info("Ok...")
pass
if self.selectedRow < 0 or self.selectedCol < 0:
rootContainer.TankOrderSelected = -1
else:
rootContainer.TankOrderSelected = self.selectedRow * 100 + self.selectedColumn
logger.info("TankOrderSelected %d" % (rootContainer.TankOrderSelected))
Trace output
12:56:48.002 [AWT-EventQueue-0] INFO com.mwes.HeartlandFarms.SemiAutoTruckLoad.LoadTankSelection.isValidTankOrderSel - Startup, from isValidTankOrderSel(1), Row 1, Col 1, Weight (A, B, C, Req) (0, 0, 0, 0)
12:56:48.002 [AWT-EventQueue-0] INFO com.mwes.HeartlandFarms.SemiAutoTruckLoad.LoadTankSelection.isValidTankOrderSel - Haven't Divided all Requested Weight yet
12:56:48.003 [AWT-EventQueue-0] INFO com.mwes.HeartlandFarms.SemiAutoTruckLoad.LoadTankSelection.isValidTankOrderSel - Returning False
12:56:48.003 [AWT-EventQueue-0] INFO com.mwes.com.mwes.heartland.onMousePress.onMousePress - Invalid...
12:56:48.004 [AWT-EventQueue-0] INFO com.mwes.com.mwes.heartland.onMousePress.onMousePress - TankOrderSelected -1
12:56:48.370 [AWT-EventQueue-0] INFO com.mwes.com.mwes.heartland.onMousePress.onMousePress - Row 1, Col 1, Value 0, 0
12:56:48.370 [AWT-EventQueue-0] INFO com.mwes.HeartlandFarms.SemiAutoTruckLoad.LoadTankSelection.isValidTankOrderSel - Startup, from isValidTankOrderSel(1), Row 1, Col 1, Weight (A, B, C, Req) (0, 0, 0, 0)
12:56:48.371 [AWT-EventQueue-0] INFO com.mwes.HeartlandFarms.SemiAutoTruckLoad.LoadTankSelection.isValidTankOrderSel - Haven't Divided all Requested Weight yet
12:56:48.371 [AWT-EventQueue-0] INFO com.mwes.HeartlandFarms.SemiAutoTruckLoad.LoadTankSelection.isValidTankOrderSel - Returning False
12:56:48.371 [AWT-EventQueue-0] INFO com.mwes.com.mwes.heartland.onMousePress.onMousePress - Invalid...
12:56:48.372 [AWT-EventQueue-0] INFO com.mwes.com.mwes.heartland.onMousePress.onMousePress - TankOrderSelected -1
12:56:48.814 [AWT-EventQueue-0] INFO com.mwes.com.mwes.heartland.onMousePress.onMousePress - Row 2, Col 1, Value 0, 0
12:56:48.814 [AWT-EventQueue-0] INFO com.mwes.HeartlandFarms.SemiAutoTruckLoad.LoadTankSelection.isValidTankOrderSel - Startup, from isValidTankOrderSel(1), Row 2, Col 1, Weight (A, B, C, Req) (0, 0, 0, 0)
12:56:48.815 [AWT-EventQueue-0] INFO com.mwes.HeartlandFarms.SemiAutoTruckLoad.LoadTankSelection.isValidTankOrderSel - Haven't Divided all Requested Weight yet
12:56:48.815 [AWT-EventQueue-0] INFO com.mwes.HeartlandFarms.SemiAutoTruckLoad.LoadTankSelection.isValidTankOrderSel - Returning False
12:56:48.815 [AWT-EventQueue-0] INFO com.mwes.com.mwes.heartland.onMousePress.onMousePress - Invalid...
12:56:48.816 [AWT-EventQueue-0] INFO com.mwes.com.mwes.heartland.onMousePress.onMousePress - TankOrderSelected -1
12:56:48.923 [AWT-EventQueue-0] INFO com.mwes.HeartlandFarms.SemiAutoTruckLoad.LoadTankSelection.propertyChange - Property TankOrderSelRow, NewValue 2, OldValue -1, SelRow 2, SelCol 1. ComponentRunning True, LoadingData False, EditMode False
12:56:48.924 [AWT-EventQueue-0] INFO com.mwes.HeartlandFarms.SemiAutoTruckLoad.LoadTankSelection.propertyChange - Property TankOrderSelCol, NewValue 1, OldValue -1, SelRow -1, SelCol -1. ComponentRunning True, LoadingData False, EditMode False
1