Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-08

fcl-web webdata example(s) on Windows has some problems

6 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

ABorka

Hi,

WinXP 32, FPC and Lazarus latest SVN checkout.

I was trying to play a little bit with the promising new fcl-web webdata features to see how JSON/EXTJS works with FPC/Lazarus and came up with the following problems in the first demo example

...fpcdir...\packages\fcl-web\examples\webdata\demo\

1. The project source files in there contains a line something like:

{$IFDEF WINDOWS}{$R somethinghere.rc}{$ENDIF}

This gives an error message during compile in Lazarus that the .rc file is not found. When commented out, they compile OK.

2. When loading the extgrid-json.html into my browser, the grid comes up, but only says "No data to display" and the data.xml debug file contains

"{ "success" : false, "message" : "Unknown web data input adaptor name: \"\"" }"

(the CGI program has access to the users.dbf file, in fact this dbf file is regenerated every time the html page is loaded)

3. When loading the extgrid-xml.html , there is a popup error message with the same 'Unknown web data input adaptor name: ""' message. The data.xml debug file has
"
<?xml version="1.0"?>
<dataset success="false">
<success>false</success>
<message>Unknown web data input adaptor name: ""</message> </dataset>
"

in it.

I could not yet figure out what the problem is due to limited time at the moment (2:00AM), any suggestions would be welcomed to find the solution/fix.

Thanks,

AB

Reply by email

Michael Van Canneyt
to ABorka
ABorka wrote 16 lines
Hi, WinXP 32, FPC and Lazarus latest SVN checkout. I was trying to play a little bit with the promising new fcl-web webdata features to see how JSON/EXTJS works with FPC/Lazarus and came up with the following problems in the first demo example ...fpcdir...\packages\fcl-web\examples\webdata\demo\ 1. The project source files in there contains a line something like: {$IFDEF WINDOWS}{$R somethinghere.rc}{$ENDIF} This gives an error message during compile in Lazarus that the .rc file is not found. When commented out, they compile OK.

I haved removed it.

Show quoted text 10 lines
2. When loading the extgrid-json.html into my browser, the grid comes up, but only says "No data to display" and the data.xml debug file contains "{ "success" : false, "message" : "Unknown web data input adaptor name: \"\"" }" (the CGI program has access to the users.dbf file, in fact this dbf file is regenerated every time the html page is loaded)

This is something else; That error appears normally before accessing the data file.

Show quoted text 14 lines
3. When loading the extgrid-xml.html , there is a popup error message with the same 'Unknown web data input adaptor name: ""' message. The data.xml debug file has " <?xml version="1.0"?> <dataset success="false"> <success>false</success> <message>Unknown web data input adaptor name: ""</message> </dataset> " in it.

Same problem as in 2, just the output is formatted differently.

The problem seems to be that no web-input adaptor is found, when in fact the adaptor assigned in the action handler.

I could not yet figure out what the problem is due to limited time at the moment (2:00AM), any suggestions would be welcomed to find the solution/fix.

I have fixed the example. Revision 15817.

Michael.

Reply by email

ABorka
to Michael Van Canneyt
Show quoted text 7 lines
> WinXP 32, FPC and Lazarus latest SVN checkout. > > I was trying to play a little bit with the promising new fcl-web > webdata features to see how JSON/EXTJS works with FPC/Lazarus and came > up with the following problems in the first demo example > > ...fpcdir...\packages\fcl-web\examples\webdata\demo\

.
.snip
.

Show quoted text 7 lines
> I could not yet figure out what the problem is due to limited time at > the moment (2:00AM), any suggestions would be welcomed to find the > solution/fix. I have fixed the example. Revision 15817. Michael.

Hi Michael,

Thanks for the fix. I really look forward to use these new features. I was testing a little further and here are the current results. (Sorry if this is a little bit lengthy, but I would really like to see this through and have super demo programs for both Linux/Windows people. Also, to learn how to use these new Lazarus/FPC features, of course.) If I can help with some simple works to get this done - other than these testings - , please let me know how.

a; fcl-web, fpweb general
1. It would be really nice to have the fpweb action names generated properly (like Delphi) in Lazarus (
http://bugs.freepascal.org/view.php?id=15820 )

2. The other demo apps (demo2...demo6) also have the .rc file line in the project .lpr source

3. Demos.txt in the ...examples\webdata\ folder mentions Demo1, but the directories go as Demo, Demo2, Demo3 ...

4. The other fpweb dependent demos (ex: fptemplate) were moved into the \lazarus\components\fpweb\demo\ directory from the fpc\packages\fcl-web. Shouldn't we have these demo programs in one place only?

5. Packages "weblaz" and "lazwebextra" in Lazarus (under fpweb directory) should have somewhat similar name and definitely some description. In the Lazarus fpweb directory the file names and package names need to be organized a little bit. I know this is vague...

b; demo (...\examples\webdata\demo)
1. Delete button should maybe have a confirmation dialog and to not have to click on Save after clicking on Delete to actually delete a record.

2. minor, nice to have: Maybe autosave after leaving any cell after editing? Bigot Excel/OpenOffice using customers will expect it to work like that. I know this is just a simple demo...

3. Maybe note for Windows people that they probably need to put the CGI program into their cgi-bin directory after compilation, and copy the .dbf file next to it.
Then they need to modify the extgrid*.js files and change the extgrid.cgi to something like
"http://127.0.0.1:8080/cgi-bin/extgrid.cgi" or similar (it works with .cgi on Windows with Apache, there is no need to have the .exe extension). Also, to put the .html and .js files into their DocumentRoot directory under folder "demo" or something.
Also, to unzip the downloaded extjs zip file into their DocumentRoot (and there will be an ignorable problem in the docs folder somewhere during unzipping, because it seems extjs uses menu.html and Menu.html files in the same directory in one place /v3.2.1/, which Windows does not support).

4. The JSON html is working now, but the xml one doesn't list anything in the grid. This might be that I did something wrong, will check demo2 and try both there.

c; demo2 - demo6
1. "The following package failed to load: lazwebdata" (there are a lazwebdata.pas and reglazwebdata.pp files in the demo directory, so that might be something to use somehow)

2. minor, nice to have: Would be nicer to use different project names than extgrid (extgrid.cgi) for people who only use the cgi-bin directory to put CGI programs on their web server installation and do not overwrite the other demo project CGI programs.

Thanks for your time, and nice work guys on this! I'll test and learn further.

AB

Reply by email

Michael Van Canneyt
to ABorka
ABorka wrote 27 lines
>> WinXP 32, FPC and Lazarus latest SVN checkout. >> >> I was trying to play a little bit with the promising new fcl-web >> webdata features to see how JSON/EXTJS works with FPC/Lazarus and came >> up with the following problems in the first demo example >> >> ...fpcdir...\packages\fcl-web\examples\webdata\demo\ . .snip . >> I could not yet figure out what the problem is due to limited time at >> the moment (2:00AM), any suggestions would be welcomed to find the >> solution/fix. > > I have fixed the example. Revision 15817. > > Michael. Hi Michael, Thanks for the fix. I really look forward to use these new features. I was testing a little further and here are the current results. (Sorry if this is a little bit lengthy, but I would really like to see this through and have super demo programs for both Linux/Windows people. Also, to learn how to use these new Lazarus/FPC features, of course.) If I can help with some simple works to get this done - other than these testings - , please let me know how.

The more it is tested, the better.
If you have ideas for improvement, please let us know.

a; fcl-web, fpweb general 1. It would be really nice to have the fpweb action names generated properly (like Delphi) in Lazarus ( http://bugs.freepascal.org/view.php?id=15820 )

I think this can be fixed in fpweb by implementing 'GetDisplayName' in the actions.

Show quoted text 6 lines
2. The other demo apps (demo2...demo6) also have the .rc file line in the project .lpr source 3. Demos.txt in the ...examples\webdata\ folder mentions Demo1, but the directories go as Demo, Demo2, Demo3 ...

:/ I'll fix this.

4. The other fpweb dependent demos (ex: fptemplate) were moved into the \lazarus\components\fpweb\demo\ directory from the fpc\packages\fcl-web. Shouldn't we have these demo programs in one place only?

Yes and no.
In theory, the demos can work without Lazarus, so it is fitting to put them in the FCL. But I do use lazarus to develop them, simply because it is much more easy then.

Show quoted text 5 lines
5. Packages "weblaz" and "lazwebextra" in Lazarus (under fpweb directory) should have somewhat similar name and definitely some description. In the Lazarus fpweb directory the file names and package names need to be organized a little bit. I know this is vague...

I will submit patches with better descriptions.

Show quoted text 5 lines
b; demo (...\examples\webdata\demo) 1. Delete button should maybe have a confirmation dialog and to not have to click on Save after clicking on Delete to actually delete a record.

I will gladly accept patches for this :-)

2. minor, nice to have: Maybe autosave after leaving any cell after editing? Bigot Excel/OpenOffice using customers will expect it to work like that. I know this is just a simple demo...

Same remark as previous. ExtJS has 'autoSave : true' so it should not be hard.

3. Maybe note for Windows people that they probably need to put the CGI program into their cgi-bin directory after compilation, and copy the .dbf file next to it.

? if you use Apache, then an AddHandler .cgi cgi statement should enable execution of CGI programs anywhere ?

Are you using IIS ?

Show quoted text 10 lines
Then they need to modify the extgrid*.js files and change the extgrid.cgi to something like "http://127.0.0.1:8080/cgi-bin/extgrid.cgi" or similar (it works with .cgi on Windows with Apache, there is no need to have the .exe extension). Also, to put the .html and .js files into their DocumentRoot directory under folder "demo" or something. Also, to unzip the downloaded extjs zip file into their DocumentRoot (and there will be an ignorable problem in the docs folder somewhere during unzipping, because it seems extjs uses menu.html and Menu.html files in the same directory in one place /v3.2.1/, which Windows does not support).

In short: more installation instructions for the demos ?

Show quoted text 10 lines
4. The JSON html is working now, but the xml one doesn't list anything in the grid. This might be that I did something wrong, will check demo2 and try both there. c; demo2 - demo6 1. "The following package failed to load: lazwebdata" (there are a lazwebdata.pas and reglazwebdata.pp files in the demo directory, so that might be something to use somehow)

No, this is the old package name before it was renamed to lazwebextra. I will check this.

Show quoted text 5 lines
2. minor, nice to have: Would be nicer to use different project names than extgrid (extgrid.cgi) for people who only use the cgi-bin directory to put CGI programs on their web server installation and do not overwrite the other demo project CGI programs.

This could be done, yes. I'll gladly accept patches for this.

Michael.

Reply by email

ABorka
to Michael Van Canneyt

...snip...

Show quoted text 7 lines
> c; demo2 - demo6 > 1. "The following package failed to load: lazwebdata" (there are a > lazwebdata.pas and reglazwebdata.pp files in the demo directory, so > that might be something to use somehow) No, this is the old package name before it was renamed to lazwebextra. I will check this.

It seems this is just in the .lpi file, when removed in Lazarus from the project as dependency and removed the .rc line from the project source, then demo2 compiles OK.

However, demo2 does not want to display anything in the grid despite writing out the response into a debug file the data seems to be OK. Not only that, the add/save buttons are working because adding a new record and saving, then refreshing the grid the debug file shows the new record. It just doesn't display anything in the grid here. This is interesting because there are virtually no differences between demo and demo2 .html and .js files.

ROUND 2

a; demo
1. xml is working for the first demo, there was no problem, maybe a reboot helped or something.

b; demo, demo1...demo6
1. minor: In the *.js files iconCls are used a few times, however, there are no 'icon-add', 'icon-delete' and 'icon-save' css parts included (and those are not included in the extjs release either) so background images are not shown for the toolbar buttons.
ex. somewhere there should be a
.icon-add
{

   background:url(/images/add.gif) 0 no-repeat !important;

}
etc. or similar defined to see button images (of course the gifs are also needed)

c; demo6
1. in extgrid.ini is that a real user name and password ;)

I will play further and try to figure out why the grid in demo2 doesn't show anything despite the data replied seems OK both with JSON and XML.

AB

Reply by email

ABorka
to Michael Van Canneyt: The more it is tested, the better. If you have ideas for improvement, please let us know.…

...snip...

Show quoted text 11 lines
> 4. The JSON html is working now, but the xml one doesn't list anything > in the grid. This might be that I did something wrong, will check > demo2 and try both there. > > c; demo2 - demo6 > 1. "The following package failed to load: lazwebdata" (there are a > lazwebdata.pas and reglazwebdata.pp files in the demo directory, so > that might be something to use somehow) No, this is the old package name before it was renamed to lazwebextra. I will check this.

Also, for demo...demo6
In the *xml.js files the 4th API cgi line has an extra comma at the end, this is one reason the xml ones didn't work I think (the last line doesn't need comma at the end in the lists)

AB

Reply by email