In vision, I am trying to open a window with a table row selection and pass a parameter from the row selection to the opening window. I am able to open the window but it doesn't pass the parameter to the tables custom property 'Date'. I have the same custom property 'Date' on the window where I am selecting the row from the table. Any ideas?
table = event.source
if table.selectedRow>=0:
param = table.data.getValueAt(table.selectedRow, "DateOnly")
system.nav.openWindow("Maintenance/Burner Off/Dryer 1 Burner Day History
{"Date": param})
This is a propertyChange event on the table? Perhaps try rewriting it like this:
if event.propertyName == 'selectedRow' and event.NewValue > -1:
param = table.data.getValueAt(event.newValue, "DateOnly")
system.nav.openWindow("Maintenance/Burner Off/Dryer 1 Burner Day History", {"Date": param})
Note how this can only happen on one propertyChange event, and that a missing quotation mark on your window path as well as a comma seperating the path and the parameters have been added.
Edit: Removed an inadvertent enter after the widow path
I'm glad you got it to work, but please consider the script I offered. The best practice is to limit propertyChange event scripts to specific properties. The initial if statement for any propertyChange event should include the property name, and all scripting logic for that event should occur within that if statement. Otherwise that code will evaluate for every property that changes on the component.
Traceback (most recent call last):
File "<event:mouseClicked>", line 1, in <module>
AttributeError: 'java.awt.event.MouseEvent' object has no attribute 'propertyName'