[Gambas-user] Filling a WebTable (need help)

Bruce Steers bsteers4 at gmail.com
Sun Jul 24 17:25:29 CEST 2022


On Thu, 21 Jul 2022 at 22:03, Claus Dietrich <claus.dietrich at freenet.de>
wrote:

> >Thank you Benoit.
> >I'll get some info on the wiki once i get my head around it.
>
> Hi Bruce
> As Benoit wrote it is filled through the data event and there
> actually not much to do get it work. The following lines are
> put together to make you understand how it works.
>
> Dim Matrix As New Variant[5, 9]  '5 stands for the column, 9 for the row
> Dim i as Integer
>
> WebTable1.Columns.Count = 5
> WebTable1.Count = 9 'can be set dynamically
>
> For i = 0 To 7
>     Matrix[0, i] = "<p align ='left'
> style='vertical-align:middle'>Col1</p>"
>     Matrix[1, i] = "<p align ='left'
> style='vertical-align:middle'>Col2</p>"
>     Matrix[2, i] = "<p align ='left'
> style='vertical-align:middle'>Col3</p>"
>     Matrix[3, i] = "<p align ='right'
> style='vertical-align:middle'>Col4</p>"
>     Matrix[4, i] = "<p align ='right'
> style='vertical-align:middle'>Col5</p>"
> Next
>
> Public Sub WebTable1_Data(Row As Integer, Column As Integer, Data As
> WebTableData)
>
>    Data.Html = Matrix[Column, Row]
>
> End
>
> Please take note, that I launched a bug report, because the WebTable
> doesn't
> display icons when the web app has been compiled and deployed on a Lighttpd
> Web server. <http://gambaswiki.org/wiki/doc/netiquette>


I looked for the bug report on the bugtracker but could not find it.

I had trouble using <img> in the webtable when using images in my project
folder.

i got it working by not using the files in the app but using them from the
host addresses.

I used this code...


*  $sHost = Replace(Env["HTTP_HOST"], "http://", "")  If $sHost =
"localhost" Or If InStr($sHost, "127.0.0.1") Or If $sHost = "::1" Then
$sHost = "http://127.0.0.1 <http://127.0.0.1>" Else $sHost = "http://" &
$sHost*

then put the images in my local lighttpd server and my remote one and
removed them from the project.
then if my app is running on my local server of through the IDE debugger it
uses the images at http://127.0.0.1/  or it uses them at the server.

Got it all working here...
http://138.68.116.47/cgi-bin/MyPlayer.gambas

the audio images work like play buttons when clicked

BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220724/5d982989/attachment.htm>


More information about the User mailing list