KLTableView

I have a question about KLTableView.

I have some code on the shown event of a webpage.Shown event like this:

[code] if (rsTitles.RecordCount > 0) and (rsTitles <> nil) Then
for i as integer = 0 to 30
Dim Cell as new TitleCellView
Cell.CellLabel.Text = rsTitles.Field(“TITLE”).StringValue
CellArray.Append(cell) // We append the cell to the model.
rsTitles.MoveNext
next i
End if

self.TitleView.ReloadData()[/code]

rsTitles is just a recordset and it does have data. The code runs fine without error but does nothing shows up in the tableview. The text is actually set in the labels but not visible on the screen. I did check and validate this.

I also have some code in the TableScrolledToEnd event like this:

While not rsTitles.EOF for i as integer = 0 to 10 //We are going to add 10 more cells at the end when the user scrolls all the way down. rsTitles.MoveNext Dim Cell as new TitleCellView CellArray.Append(cell) // We append the cell to the model. TitleView.AppendCell //And we command an append to the TableViewController... Cell.CellLabel.Text = rsTitles.Field("TITLE").StringValue next i exit Wend

This code loads data into the TableView and its visible.

Is there something I may be missing on the first set of code for the shown event?

Thanks,

Tom

I will take a look at your code.

I think i took a bad approach on using events for asking for information. I was using them more like protocols or interfaces… I am working on a much simpler method based KLTableView using a more preferred code pattern embraced by Xojo which is method based… (AddRow(), DeleteRow(), InsertRow(), etc… ) …

That said, I had used the code in the actual KLTableView and it works with a fairly large data source… I will take a closer look to your code though.

[quote=76945:@Tom Russell]I have a question about KLTableView.

Is there something I may be missing on the first set of code for the shown event?

Thanks,

Tom[/quote]

Move your code to the shown event of the KLTableView instance… I think the page is shown but the TableView hasn’t instantiated or drawn yet…