Main Board > Webster Plus

grid display using program - grid does not show

(1/2) > >>

Jon Toomsen:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
[ttl]Grid[/ttl]<br>
[grid MyGrid program="myprog.pxp;makegrid" size=auto/20 ]
[col Source=ItemCode$ ttl="ItemCode" width=30 ]
[col Source=ItemName$ ttl="Name" width=50]
[col Source=ItemType$ ttl="Type" width=2]
[/grid]
</body>
</html>



! myprog.pxp
 MAKEGRID:
 OPEN (HFN,IOL=GRIDIOL)"*memory*"
 LET MYGRID=LFO
 SELECT * FROM INTERNETITEM
 WRITE (MYGRID)
 NEXT RECORD
 EXIT
 GRIDIOL:IOLIST ITEMCODE$,ITEMNAME$,ITEMTYPE$
 !


Devon Austen:
Hi Jon,

When debugging a Webster issue the first step is to hover over the red highlighted section on the page. The tool tip will give you error information which will help you figure out your issue.

I believe your issue is that your page does not have a [form] and the grid needs to be in a [form].

You also need to add

ENTER MYGRID

right under the MAKEGRID: line

This is how the grid program can pass back the handle to the grid memory file.

So try this:

<!DOCTYPE html>
<html>
<head>
</head>
<body>
[ttl]Grid[/ttl]<br>
[form]
[grid MyGrid program="myprog.pxp;makegrid" size=auto/20 ]
[col Source=ItemCode$ ttl="ItemCode" width=30 ]
[col Source=ItemName$ ttl="Name" width=50]
[col Source=ItemType$ ttl="Type" width=2]
[/grid]
[/form]
</body>
</html>



! myprog.pxp
 MAKEGRID:
ENTER MYGRID
 OPEN (HFN,IOL=GRIDIOL)"*memory*"
 LET MYGRID=LFO
 SELECT * FROM INTERNETITEM
 WRITE (MYGRID)
 NEXT RECORD
 EXIT
 GRIDIOL:IOLIST ITEMCODE$,ITEMNAME$,ITEMTYPE$

Normally you would have a program= in the [form] to specify the program to run when form is submitted and that would handle any events on the page.

For information on the use of the form see here:
https://manual.pvxplus.com?Webster/Webster%20Application%20Design.htm

For the need for the ENTER you can see the program= short code documentation here: https://manual.pvxplus.com?Webster/Short%20Code%20Options.htm

It looks like we need to update the example on the Using Grids in Webster+ documentation page to include the ENTER statement as that is missing.

Jon Toomsen:
[form] was needed now a shell of the grid is shown.

Now I have internetitem not found in dictionary.
have tried both ways - program= and the execute statement

I have an application library under the prog folder.
The query for internetitem works.

.

Devon Austen:
Is the channel number for a open file in the variable INTERNETITEM of is the name of the file INTERNETITEM. If that is the name of the file you are just missing quotes in the select statement

i.e.

SELECT * FROM "INTERNETITEM"

Jon Toomsen:
added quotes - it is not a channel no ( was a typo earlier )

Navigation

[0] Message Index

[#] Next page

Go to full version