[Lazarus] jQuery interface for fcl-web

Joost van der Sluis joost at cnoc.nl
Mon Jun 8 15:04:08 CEST 2009


Op maandag 08-06-2009 om 14:05 uur [tijdzone +0200], schreef Michael Van
Canneyt:
> 
> On Sun, 7 Jun 2009, Joost van der Sluis wrote:
> 
> >
> > Attached is the source with an example. Install the package and compile
> > the example. (Change the parameters so it fits to your database) Place
> > the resulting executable on a web-server and configure it so it's
> > recognized as an cgi-application. You also have to download jQuery and
> > jGrid and place those files in the same directory as the cgi-appliation.
> >
> > It's pretty simple but easy to extend. I hope there will grow something
> > out of it.
> 
> It seems very promising. If I understand  it correctly, this is a way
> to include javascript client-side components in a a webpage.

Yes, that's the idea.

> The TjQueryGrid just produces enough HTML/javascript so the browser knows 
> where to point to, has some methods to create the data, and the rest is 
> done by the javascript code from the javascript jQuery component?

Yes. There are also some callback-functions. For example, the
jQuery-client side framework connects to
http://menora.cnoc.nl/extern/jquery/fpcjquery.psp?action=data&compname=jquerygrid1 to retrieve the data. (try it, you'll see the xml-data. json could also be added) This request is also handled. In case some grid is edited, the same happens. You can assign a method to TjQueryGrid.OnCellEdit and this method is called when some data changes.

> I suspect that for production code, you would still need to add some 
> session info to the whole ?

Well, yes. But you could use the FCL-web sessions. But in that case the
programmer has to realize that, for example the OnCellEdit event will be
executed in a complete new run of the program. (not on fcgi/apache
module, but yuo get the idea)

I'm still thinking about adding an option to the apache-modules and fcgi
to let the TWebModule stay in memory, as some kind of session with a
timeout. That would add a lot of other possibilities.... (more
servlet-like)

> Impressive, and another step on the road to something Intraweb-like. 
> What would be your proposed next steps ?

Ehm.... Show it to one of our customers and hope they bite. ;)

First I would add some more widgets. Therefor I need to add some
interfaces. Then I think I want to take a look at the persistent
web-modules...

What helps when you have a project you want to work on. So you discover
what features you miss. Do you have an idea for something usefull?

Joost.





More information about the Lazarus mailing list