It doesn’t matter what code is in the cell. It can simply be a MsgBox to display the row number and it fails with the same “Unhandled OutOfBoundsException” (scroll up for that previous experiment^).
However, here is the code that is supposed to be in the cell that works in the IDE and all the code it subsequently calls.
[code]WebPage1.CellClick(Row As Integer, Column As Integer)
Dim b As Boolean
b = Session.JobSelected(Row)
If b = True Then
Timer_HideThumbs.Mode = 1
Else
MsgBox “Error retrieving Job Data”
End If
[/code]
[code]Sub Session.JobSelected(CurrentJobID As Integer) As Boolean
Dim rs As RecordSet
Dim sqlStrng As String
Dim i,n As Integer
Session.LogDebugData(Str(CurrentJobID))
Session.LogDebugData(Str(Ubound(Session.JobData,1)))
Session.LogDebugData(Str(Ubound(Session.JobData,2)))
Session.LogDebugData(Str(WebPage1.ListBox_Jobs.LastIndex))
WebPage1.ThumbsCoreCC.Visible = False
WebPage1.ProgressWheel1.Visible = True
WebPage1.LabelLoadingThumbs.Visible = True
Session.ControlsEnableState(False)
// JOB_ARCHIVE_ID=0 JOB_NAME=1 JOB_NUMBERID=2 JOB_YEARID=3 CUSTOMER_NAME=4 CD_TRIM_SIZE=5 CD_BINDING=6 DELIVERY_CODE=7 NUMBER_OF_COPIES=8 ACTUAL_SHIP_DATE=9
Session.dbJobID = Session.JobData(CurrentJobID,0)
Session.dbJobName = Session.JobData(CurrentJobID,1)
Session.dbJobYearID = Session.JobData(CurrentJobID,3)
Session.dbJobCustomerName = Session.JobData(CurrentJobID,4)
Session.dbJobTrimSize = Session.JobData(CurrentJobID,5)
Session.dbJobBindingStyle = Session.JobData(CurrentJobID,6)
Session.dbNumPages = Session.JobData(CurrentJobID,7)
Session.dbJobDeliveryCode = Session.JobData(CurrentJobID,8)
Session.dbJobNumCopies = Session.JobData(CurrentJobID,9)
Session.dbJobShipDate = Session.JobData(CurrentJobID,10)
WebPage1.JobInfoCC.Label_dbJobName.Text = “Job Name: " + Session.dbJobName
WebPage1.JobInfoCC.Label_dbJobNumber.Text = “Job Number: " + NthField(Session.dbJobName,”-”,1)
WebPage1.JobInfoCC.Label_dbJobYear.Text = "Job Year: " + Session.dbJobYearID
WebPage1.JobInfoCC.Label_dbJobCustomerName.Text = "Customer Name: " + Session.dbJobCustomerName
WebPage1.JobInfoCC.Label_dbJobTrimSize.Text = " Trim Size: " + SelectTrimSize(Session.dbJobTrimSize)
WebPage1.JobInfoCC.Label_dbJobBindingStyle.Text = "Binding Style: " + SelectBindingStyle(Session.dbJobBindingStyle)
WebPage1.JobInfoCC.Label_dbJobNumPages.Text = "Pages: " + Session.dbNumPages
WebPage1.JobInfoCC.Label_dbJobNumCopies.Text = "Copies: " + Session.dbJobNumCopies
WebPage1.JobInfoCC.Label_dbJobDeliveryCode.Text = "Delivery: " + Session.dbJobDeliveryCode
WebPage1.JobInfoCC.Label_dbShipDate.Text = "Ship Date: " + ConvertDate(Session.dbJobShipDate)
// Re-dimension the Jobs Thumbnail and Medium Res image data for the core book pages
ReDim Session.ThumbsCoreData(-1,-1)
// Query the DB for the Job image data into a recordset
sqlStrng = “SELECT FILE_NAME, THUMBNAIL_PATH, MEDIUM_RES_PATH, PAGE_TYPE, PAGE_NUMBER FROM page_data WHERE JOB_ARCHIVE_ID = '” + Session.dbJobID + “’ AND PAGE_TYPE = ‘Core’”
// FILE_NAME=0 THUMBNAIL_PATH=1 MEDIUM_RES_PATH=2 PAGE_TYPE=3 PAGE_NUMBER=4
rs = Session.MySQLDB.SQLSelect(sqlStrng)
//Append each record into the ThumbsCoreData array
If rs <> NIL Then
n = rs.RecordCount - 1
i = rs.FieldCount -1
ReDim Session.ThumbsCoreData(n,i)
n = 0
While Not rs.EOF
For i = 1 To rs.FieldCount
Session.ThumbsCoreData(n,(i - 1)) = rs.IdxField(i).StringValue
Next
n = n + 1
rs.MoveNext
wend
Return True
Else
ShowAlert(“Database Error”,"Database Error " + EndOfLine + Session.MySQLDB.ErrorMessage + “.”,“Caution”)
Return False
End If
End Sub[/code]
WebPage1.Timer_HideThumbs.Action
Session.HideThumbs
[code]Sub Session.HideThumbs
Dim i,n As Integer
Dim p As WebPicture
p = blankthumb
If Not p.Preload Then
// Browser was unable to preload the picture
// Not handling False condition
End If
n = (WebPage1.ThumbsCoreCC.ControlCount / 3) -1
For i = 0 To n 'Ubound(Session.ThumbsCoreData,1)
WebPage1.ThumbsCoreCC.ImageViewThumb(i).Visible = False
WebPage1.ThumbsCoreCC.ImageViewThumb(i).Top = 0
WebPage1.ThumbsCoreCC.ImageViewThumb(i).Left = -200
WebPage1.ThumbsCoreCC.ImageViewThumb(i).Picture = p
WebPage1.ThumbsCoreCC.LabelThumbName(i).Visible = False
WebPage1.ThumbsCoreCC.LabelThumbName(i).Top = 0
WebPage1.ThumbsCoreCC.LabelThumbName(i).Left = -200
WebPage1.ThumbsCoreCC.LabelThumbName(i).Text = ""
WebPage1.ThumbsCoreCC.LabelThumbType(i).Visible = False
WebPage1.ThumbsCoreCC.LabelThumbType(i).Top = 0
WebPage1.ThumbsCoreCC.LabelThumbType(i).Left = -200
WebPage1.ThumbsCoreCC.LabelThumbType(i).Text = ""
Next
WebPage1.Timer_RetrieveThumbs.Mode = 1
End Sub[/code]
WebPage1.Timer_RetrieveThumbs.Action
Session.ThumbsCoreCreate
[code]Sub Session.ThumbsCoreCreate
Dim i,picWidth,picHeight As Integer
Dim b As Boolean
Dim img As FolderItem
Dim FilePath As String
Dim ImgBox As WebImageView
Dim DescName,DescType As WebLabel
Dim pic As WebPicture
// Retrieve the thumbnail paths and add WebPictures to the ControlSet creating controls if they don’t already exist
For i = 0 to UBound(Session.ThumbsCoreData,1)
If WebPage1.ThumbsCoreCC.ImageViewThumb(i) = Nil Then
ImgBox = WebPage1.ThumbsCoreCC.AddImageViewThumb
DescName = WebPage1.ThumbsCoreCC.AddLabelThumbName
DescType = WebPage1.ThumbsCoreCC.AddLabelThumbType
End If
FilePath = Session.ThumbsCoreData(i,1)
img = GetFolderItem(FilePath)
If Not (img = Nil) Then
If img .Exists Then
pic = WebImageView.Picture.Open(img)
// Preload the images to the web browser as the images are retrieved
If Not pic.Preload Then
// Browser was unable to preload the picture
// Not handling False for now
End If
Else
// Not Available images based on book Trim Size
If Session.dbJobTrimSize = “7” Then
pic = NA7
ElseIf Session.dbJobTrimSize = “8” Then
pic = NA8
ElseIf Session.dbJobTrimSize = “9” Then
pic = NA9
End If
End If
End If
picWidth = pic.Width
picHeight = pic.Height
WebPage1.ThumbsCoreCC.ImageViewThumb(i).Width = picWidth
WebPage1.ThumbsCoreCC.ImageViewThumb(i).Height = picHeight
WebPage1.ThumbsCoreCC.ImageViewThumb(i).Picture = pic
WebPage1.ThumbsCoreCC.LabelThumbName(i).Text = Session.ThumbsCoreData(i,0)
WebPage1.ThumbsCoreCC.LabelThumbType(i).Text = Session.ThumbsCoreData(i,3) + " Page"
Next
// Arrange the thumbnail images control sets in the ContainerControl
b = Session.ThumbsCoreArrange
// Make the Progress wheel invisible and the ContainerControl visible
If b = True Then
WebPage1.ProgressWheel1.Visible = False
WebPage1.LabelLoadingThumbs.Visible = False
Session.ControlsEnableState(True)
WebPage1.ThumbsCoreCC.Visible = True
End If
End Sub[/code]
[code]Sub Session.ThumbsCoreArrange As Boolean
// Dimension the variables that need to be calculated
Dim idx,column,row,columnLeft,rowTop,rowCount,columnCount As Integer
// Dimension the number of pictures in the Picture Array ThumbsCore()
Dim ImageCount As Integer = Ubound(Session.ThumbsCoreData,1)
// calculate the desired image spacing variables
Dim Hspacing As Integer = 20
Dim Vspacing As Integer = 44
Dim posLeft As Integer = 0
Dim posTop As Integer = 0
Dim MaxWidth As Integer = 144
Dim MaxHeight As Integer = 192
Dim columnWidth As Integer = MaxWidth + Hspacing
Dim rowHeight As Integer = MaxHeight + Vspacing
// Calculate the number of columns
columnCount = WebPage1.ThumbsCoreCC.Width / columnWidth
If (WebPage1.ThumbsCoreCC.Width - (columnCount * columnWidth)) > (columnWidth / 2) Then
columnCount = columnCount + 1
End If
// Calculate the number of columns
rowCount = (ImageCount / columnCount)
If (ImageCount - (rowCount * columnCount)) > 0 Then
rowCount = rowCount +1
End If
// Set the image index to zero
idx = 0
// Arange the ContainerControl’s control sets in a grid og rows and columns
for row = 0 to rowCount
rowTop = (posTop + (row * rowHeight))
for column = 0 to columnCount -1
columnLeft = (posLeft + (column * columnWidth))
WebPage1.ThumbsCoreCC.ImageViewThumb(idx).Left = ColumnLeft + ((MaxWidth - WebPage1.ThumbsCoreCC.ImageViewThumb(idx).Width) / 2)
WebPage1.ThumbsCoreCC.LabelThumb(idx).Left = ColumnLeft
WebPage1.ThumbsCoreCC.ImageViewThumb(idx).Top = RowTop + (MaxHeight - WebPage1.ThumbsCoreCC.ImageViewThumb(idx).Height) / 2
WebPage1.ThumbsCoreCC.LabelThumb(idx).Top = (RowTop + 198)
WebPage1.ThumbsCoreCC.ImageViewThumb(idx).Visible = True
WebPage1.ThumbsCoreCC.LabelThumb(idx).Visible = True
If idx = ImageCount Then
Return True
Else
idx = idx + 1
End If
next column
next row
Return True
End Sub[/code]