09-09-2010, 07:35 PM
--So I'm trying to select a certain row from a javatable.
My code is this--
--each time I check with a messagebox and see that the variable "rowtoselect" gives me a integer, and it does me a correct integer, but when I use the command .SelectRow it only selects the first row of my javatable. Another weird thing is when I input some command such as SelectRow "#10" it selects row 10 with no problem, it just won't work when I use my variable as my row number. Can anyone offer any advice as to what may be wrong?--
--as a side note I also checked to see if the parameters were coming through from the previous steps and they were coming through fine--
My code is this--
Code:
Dim numrows
numrows = JavaWindow().JavaTable().JavaInternalFrame().GetROProperty("rows")
numrows = Cint(numrows)
Dim i
i = 0
Dim rowtoselect
rowtoselect = -1
While i<numrows AND rowtoselect = -1
If Cint(JavaWindow().JavaInternalFrame().JavaTable().GetCellData(i,0)) = Cint(parameter("itemone")) Then
rowtoselect = i
End If
i=i+1
Wend
JavaWindow().JavaInternalFrame().JavaTable().SelectRow rowtoselect
--each time I check with a messagebox and see that the variable "rowtoselect" gives me a integer, and it does me a correct integer, but when I use the command .SelectRow it only selects the first row of my javatable. Another weird thing is when I input some command such as SelectRow "#10" it selects row 10 with no problem, it just won't work when I use my variable as my row number. Can anyone offer any advice as to what may be wrong?--
--as a side note I also checked to see if the parameters were coming through from the previous steps and they were coming through fine--