Recent

Author Topic: New widget set : Web Application mode  (Read 73770 times)

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
New widget set : Web Application mode
« Reply #15 on: June 27, 2006, 01:06:32 pm »
Also, I am finishing converting Apache 2 headers to Free Pascal, so in the near future we should also be able to write apache modules.

With this a internet widgetset can generate Apache 2 modules, just like IntraWeb does. Another option for developers ^^

SergKam

  • New Member
  • *
  • Posts: 29
Excuse for my English

CCRDude

  • Hero Member
  • *****
  • Posts: 501
New widget set : Web Application mode
« Reply #17 on: July 05, 2006, 09:38:40 pm »
I can't understand russian, but a webserver example is also part of Synapse already - the difficult point here is to convert a GUI to interactive websites ;)

Anonymous

  • Guest
New widget set : Web Application mode
« Reply #18 on: July 06, 2006, 08:30:20 am »
That server has help and description in English. It's very simple, but crossplatform and can be used as example.

Anonymous

  • Guest
New widget set : Web Application mode
« Reply #19 on: July 06, 2006, 02:19:23 pm »
Quote from: "CCRDude"
I can't understand russian, but a webserver example is also part of Synapse already - the difficult point here is to convert a GUI to interactive websites ;)

Not so difficult. for example.
Code: [Select]

object Form3: TForm3
  Caption = 'TEST'
  Left = 425^
  Height = 269^
  Top = 175^
  Width = 255^
 
...
  object BitBtn1: TBitBtn
     Caption = 'Tst'
     Default = True
     Kind = bkOK
     ModalResult = 1
     TabOrder = 0
     Left = 16
     Height = 30
     Top = 232
     Width = 96
   end
...
end
------------------------------------------------
//set simple ajax structure
<div id=AJAX>
</div>
//set ajax calbacks
<SCRIPT>
function SendClick(id){
var query='<script src="?func=SendClick&var1='+id+'"></script>'
document.getElementById(AJAX).innerHTML='get';
}
</SCRIPT>
//set form
<table><tr width=255><td heigth=269>
 TEST
  <form>
   <input id=BitBtn1 type=button value='Tst' OnClick="javascript:SendClick('BitBtn')">
  </form>
<td><tr></table>

I can help with javascript, AJAX and HTML
I think it can`t be done as Lazarus Widget but as components set

SergKam

  • New Member
  • *
  • Posts: 29
New widget set : Web Application mode
« Reply #20 on: July 06, 2006, 03:05:13 pm »
It was my post.
smoll corections
Code: [Select]

<SCRIPT>
function SendClick(id){
var query='<script src="?func=SendClick&var1='+id+'"></script>'
document.getElementById(AJAX).innerHTML='query';
AjaxStart();
}
</SCRIPT>

on server
Code: [Select]

function Form3.onClickBitBtn1()
begin
  BitBtn1.Capton:='hello';
end;
----------
http.respons:='<SCRIPT>
function AjaxStart(){
document.getElementById('+id+').value="'+HelloVar+'" ;
}
</SCRIPT>'
Excuse for my English

CCRDude

  • Hero Member
  • *****
  • Posts: 501
New widget set : Web Application mode
« Reply #21 on: July 06, 2006, 04:00:55 pm »
Ok... so any suggestions why this server component would be better than the Synapse one? ;)

Also: why shouldn't it be able to do that as a widget set? It's just a lot of work :D AJAX is the right way, I agree with that. Firefox for example even has its own integrated AJAX JS client now.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
New widget set : Web Application mode
« Reply #22 on: July 26, 2006, 06:01:17 pm »
Good news for this idea is that you can now develop apache modules with Free Pascal.

L505

  • New Member
  • *
  • Posts: 10
New widget set : Web Application mode
« Reply #23 on: October 11, 2006, 08:22:15 pm »
Quote
Would be great. And something like PHP but in pascal.

Yes, exists Pascal Server Pages, but is discontinuated.


PSP has not been discontinued! :-)

Sometimes we leave the PasForum sitting for a few days without any response. We have a mailing list which you pretty much can get an email response right away - but the forum is less often checked and harder to keep track of. I suppose we should implement a Mailer() function in the web forum so that I get emailed each time someone posts a new response or a new post. You have to understand that I am a busy guy and I have a hard time keeping up with web forums - email is easier to keep up with.

We hammered away lots of code in January 2006-April 2006 to get psp-core 1.6 ready. THere's no sense in working on 1.6.1 until people start using 1.5.0.2 and reporting issues with it. If we develop 1.6.1 without waiting for more people to use 1.5.0.2, it will mean more bugs will be left in the code. There were a few important bugs Almindor found and I'm greatful at least he is using PSP so it can be tested. I use PSP myself for my personal and business websites but I don't use all the features of PSP - Almindor just happened to hit on some features I was not using, such as embedded CSS within a template file.

I'm working on some HTML widgetry which let's you go like this:

box.color:= hGray;
box.align:= auto;
box.render;

form.begin;
edit1.maxlength:= 10;
edit1.bgcolor:= hWhite;
edit1.render;
form.end;

I've already written a few web programs without doing any HTML by hand.
An example is here:
http://www.psp.furtopia.org/cgi-bin/psp/examples/PasHiliterDemo.psp

There is criticism from people that templates are a better solution than the above HTML pascal widgetry. It's true that templates do offer more power, because they are not limited by Pascal, they are only limited by the current HTML standard. We decided that both templates and pascal widgets would be a good solution. Some people prefer pascal widgets while others prefer HTML templates.

By html templates I mean this:

Code: [Select]

<html>
<body>
This is the {$PageName} in section one.
</body>
</html>



PSP has to be used as is too! Html widgets are cool, and OO stuff is cool - but PSP is powerful the way it is right now.

Some of you guys say that PSP is kind of a useless idea, since there is already PHP and ASP. But then why use Lazarus? Why not just use Visual C++? Visual C++ is much more mature and many times more powerful than Lazarus. It's all about the language though! I don't like PHP syntax. I like sharing code between my Delphi and FPC programs with my web programs! The PasForum FAQ explains this in great detail why I use PSP and not JSP or PHP.

sandeep_c24

  • Full Member
  • ***
  • Posts: 114
New widget set : Web Application mode
« Reply #24 on: October 15, 2006, 02:57:22 am »
Is there any plan to implement a widget set that can be used do what Intraweb dows for Delphi?

Regards

Sandeep

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
New widget set : Web Application mode
« Reply #25 on: October 17, 2006, 10:38:38 pm »
Quote from: "sandeep_c24"
Is there any plan to implement a widget set that can be used do what Intraweb dows for Delphi?


Yes, I think that Marco was doing this based on the apache headers translated.

The resulting file would be a .so that can be used with Apache 2.0 or 2.2

Almindor

  • Sr. Member
  • ****
  • Posts: 411
    • http://www.astarot.tk
New widget set : Web Application mode
« Reply #26 on: October 22, 2006, 10:36:56 am »
Once someone does the AJAX part (IMHO the most difficult thing) integrating lNet or any other networking lib with a http server shouldn't be much of a problem.

And since you did the apache headers we can also make the module approach perhaps "all in one compilcation" even. But I imagine it'd take some funk to get the events right.

EG: you make an AJAX form with an AJAX button and combobox. In combobox you put "OnClick" code for example, now you need to make sure that the client version sends you this event and that the server responds with proper widget changes to the client.

This is the problem.

hinfox

  • Newbie
  • Posts: 1
New widget set : Web Application mode
« Reply #27 on: November 05, 2006, 04:12:19 pm »
Quote
Once someone does the AJAX part (IMHO the most difficult thing) integrating lNet or any other networking lib with a http server shouldn't be much of a problem.

And since you did the apache headers we can also make the module approach perhaps "all in one compilcation" even. But I imagine it'd take some funk to get the events right.

EG: you make an AJAX form with an AJAX button and combobox. In combobox you put "OnClick" code for example, now you need to make sure that the client version sends you this event and that the server responds with proper widget changes to the client.

This is the problem.


Yes, and no. The AJAX part is the most difficult because this is a distributed system. The difficult is not the OnClick event which can be implemented easily but for example if you would like to develop a drawing application you should send tons of thousand mouse events (and the response images) in a short timeframe between the client and the server. This can eat the client bandwidth and the application becomes very slow. (Also some routers and firewalls does not like this many connections in a short time frame and identifies it a SYN flood.) Also there can be a DOS situation easily if you use the HTTP protocol for that messages because the overhead. IMO some protocol which allows persistent connections with small overhead would be required. This would guarantee two way communications too which is an other problem with HTTP. The other thing which is hard to achieve is browser compatibility especially with older browsers which does not necessairly support all required events.

One more problem is the security because the HTTP protocol is an insecure thing. How can you guarantee that nobody can change the data in transit? This can be guaranteed in a normal application but not in a HTTP environment. There should be encryption or at least some authentic signature checking algorithm implemented and integrated with session handling code. OK, it can be implemented using a property for example RequireSecurity which can be set true if security is required and HTTP is not allowed but only HTTPS.

IMO this should not tied tightly to HTML and AJAX but what the browsers support because browsers and the web in general is changing. There are new standards which is supported natively in modern browsers (such as SVG in Firefox) which should be supported in modern web widgetsets too to simplify application development using these new standards. This can be achieved if messaging code is abstracted from GUI code appropriately. Careful design required.

I used IntraWeb but have some strange problems such as freezing and inappropriate display things. The form looks in one way in the designer, another way in Firefox, and another way in IE. This is especially a problem if you require pixel precise positioning of text and widgets (especially if your clients use more than one sort of OS). Also not all controls have an IW counterpart and not all properties are the same so this is like a desktop application development but it is far from the same.

I have been thinking on such a widgetset since January in my freetime and I can help you with the design and implementation (possibly not only in my free time) but this requires more than one people and careful design. I think Apache headers would be good for this but this interface should be abstracted so other backends can be possible too.

german_tejero

  • Newbie
  • Posts: 1
New widget set : Web Application mode
« Reply #28 on: February 15, 2007, 02:51:34 am »
http://webrad.sourceforge.net/ a simple dead open source project, but very powerfull and good for start
bye bye

bee

  • Sr. Member
  • ****
  • Posts: 360
New widget set : Web Application mode
« Reply #29 on: January 14, 2008, 05:31:22 pm »
Did anyone here ever try Morfik? IMO, that's the best way we should implement Lazarus web-widget, even better than IW. Morfik makes things simpler by separate browser side event and server side event. Browser side is handled by JavaScript code, while the server side is handled by an application server (could be a CGI app or an Apache module).

Any browser action which requires to be proceed on server side would request to application server through Ajax request. The reply then will be represented on the browser side using Ajax techniques. The biggest advantage that's offered by Morfik is that we could write the browser side using object pascal too. Morfik would "compile" it into browser side JavaScript (plus auto generated HTML and CSS files), using something they called as JST (javascript synthesist technology or whatever), similar to gwt (google web toolkit). On the server side, Morfik compile object pascal code plainly using FPC. For client-server communication, they're using web service (SOAP?) protocol.

I think the idea is very possible to be done. For early stage, we could ignore about the OP to JS compiler. We could think about this on the next stage of the development. First, let the developers code the browser side event using JS. To ease our web widget effort more, we don't need to build the JS widget entirely from zero. We could use JS GUI frameworks from out there. There are some frameworks to choose upon: extjs (dual license ala mysql), qooxdoo (MPL), jQuery, and YUI. Personally, I prefer extjs though I'm not quite pleased by its license scheme. It's because extjs, AFAIK, has the most complete and stable JS GUI framework plus a comprehensive documentation. I found it the easiest framework to be understood and used. It also has almost any standard GUI controls as on Lazarus component palette, even better. :)

So, for the start, we could focus on 2 things: (1) web widget that transforms LFM into HTML+CSS+JS using chosen JS GUI framework, and (2) standard client-server communication protocol (using JS GUI and Ajax request on browser side, and app server and web service on server side). But, due web application way of works, we couldn't transform desktop app into a web app or vice versa. Just like IW or Morfik, developers should had known that s/he would build a web app since the beginning.

Had anyone done this? What do you think?
-Bee-

A long time pascal lover.