Proyecto "Web -> Controls -> Listbox -> WebListbox Datasource Example"

Buenas noches.

Estoy estudiando el proyecto de ejemplo “Web -> Controls -> Listbox -> WebListbox Datasource Example”.

En ese proyecto se implementan los métodos de la interfaz WebDataSource.

No entiendo por qué, para obtener el número de filas (método RowCount()), se hace una consulta a la base de datos. Es algo muy ineficiente. Ya existe una propiedad en el WebListBox, llamada RowCount, que nos da el número de filas.

image

Por otro lado, depurando el código, al ejecutar el método ReloadData() del WebListBox me he dado cuenta de que el método RowData() se invoca dos veces. No sé por qué.

Finalmente, según la documentación, el método RowData() no necesita parámetros, pero al implementar la interfaz WebDataSource, se requieren 3.

image

Saludos.

(I’ll be quoting the English version of what I’m answering just in case the translate tool misconstrued the message)

You are supposed to return the RowCount from that function. The existing RowCount property / function is unrelated to using WebListboxDataSource.

I’m not sure. If you think it’s misbehaving please file a feedback ticket.

Some of the API 2.0 documentation is quite poor, especially things regarding new features. You can file tickets to help the Xojo team correct or expand upon documentation when you come across issues.