HttpServer and B4X

OliverA

Expert
Licensed User
Longtime User
JQueryElement, I wrote it from scratch and the implementation will be different and also the name since it is not in Java .. it will be called QueryElement
1) Great work on a great project
2) The J in jQuery is actually for JavaScript, not Java, so technically, you could keep the name
3) You've probably already figured this out:
a) the glue between the jServer's JQueryElement and the web browser is the b4j_ws.js file
b) The code portion of jServer that uses the b4j_ws.js file can be found here https://github.com/AnywhereSoftware...rc/anywheresoftware/b4j/object/WebSocket.java and here https://github.com/AnywhereSoftware...wheresoftware/b4j/object/WebSocketModule.java
 

Star-Dust

Expert
Licensed User
I have transformed the iHttpServer library into xHttpServer.

I made a B4Pages server project which will work for B4J, B4I, B4A. I want to add 'Handler' management or something similar to make the code more readable

It is now multi-platform ... in the next few weeks I will be publishing the libraries.
 

Star-Dust

Expert
Licensed User
I am working on a class that allows the creation of websites (and WebApp) within my server.

I am thinking of several templates and styles to choose from and a wizard system for composing the page.

Video3.gif
Video4.gif


I'm not sure I can do anything decent,
I will publish it only if it is satisfactory and simple to use
 

Star-Dust

Expert
Licensed User
Server development continues.

Especially I finish jQuery class... very complex but interesting.

1623166839048.png
 
Last edited:

ilan

Expert
Licensed User
Longtime User
I am working on a class that allows the creation of websites (and WebApp) within my server.

I am thinking of several templates and styles to choose from and a wizard system for composing the page.

View attachment 110651View attachment 110652

I'm not sure I can do anything decent,
I will publish it only if it is satisfactory and simple to use

looks amazing Star-Dust, i have in my shelf a project that is very similar to your example but had not the time to start working on it since i am working on too much project simultaneously. cool project, can't wait to see the end result :)
 

Star-Dust

Expert
Licensed User
While I was studying the method, actually not very complex but functional which allowed to have templates.

I started studying a JS-based framework for building font-and web apps. I understand that something on a higher level can be done.

Create a language to integrate with the server that allows you to write a front-end WebApp by delegating the server to translate and execute the pages. A little bit what happens to PHP. But I was thinking of something that has the simplicity of React or Angular, perhaps in a language similar to b4x
 
Last edited:

Star-Dust

Expert
Licensed User
Let's give some explanations on the jQuery class.

It doesn't actually do anything, it just passes commands with a string in jSon format to the script (ws.js) which interprets them. All the work is done by the script that already exists. So why did I mention complexity? Because understanding mechanics was not easy for me.

These parameters are specified in the Json string:
  • Type (Create event, function, function with result, Method, Method with result)
  • Method (html, val, css, property, text, select, dataTable, ecc...)
  • Property (if method is property)
  • Tag identifier
  • Parameters (Array of simple or Json strings)
  • Arguments (Array of simple or Json strings)
Not all parameters are used, but only those that are needed according to the command. So it is possible to read, set or populate a TAG (Text, Event, Value, etc.), create events (click, change, focus, mouse move-down-leave-enter, keyup, etc.) and receive notifications for each event.

Then the class will just do the work of creating the command following the syntax
 

Star-Dust

Expert
Licensed User
Find attached the source of my implementation of the jQuery class that I called QueryElement.

In the future I was thinking of inserting the events raised by html TAGs as events within B4X. They are currently received as strings by the Svr_HandleWebSocket event.
 

Attachments

  • QueryElement.bas
    6.1 KB · Views: 138
Top