HTMX

aeric

Expert
Licensed User
Longtime User
Another javascript library ?
 

peacemaker

Expert
Licensed User
Longtime User
But functions look like a smaaaall revolution in webapps. No ?
 

hatzisn

Expert
Licensed User
Longtime User
Hi, All

Who knows what https://htmx.org/ technology is?
As i could understand it's something like ABMaterial...

How did you locate this himx technology? It looks kind of scary... The good programmer always plays defence in such new technologies and all the potential (or not existable) threats.
 
Last edited:

alwaysbusy

Expert
Licensed User
Longtime User
I fail to see how this compares with ABM. ABM is simply a UI layer on top of a normal B4J jetty server which allows you to write WebApps without having to write a single html tag or a line of Javascript and just familiar B4X syntax. With htmx you have to write lots of html stuff + Javascript for all business logic in your WebApp.

This htmx looks like another variation of libraries like Vue, angular etc but without the nice looking components. It 'could' probably be wrapped by BANano however I can't see any advantage by doing this over taking your favorite text editor, writing such html tags manually and write your logic in Javascript and Go.

For anyone writing WebApps in pure html/Javascript/Go I can see where this 'may' be somewhat nice (not revolutionary as these special attributes are just parsed and interpreted by their Javascript library, something the others also do. They just do it for e.g. making requests to a server). And if you want your components to.look nice, you still need to learn bootstrap or any other CSS UI framework. And after that you'll need yet another language (or two) for your business logic and/or server side.

I prefer just to use B4X for everything, but that's just me ?
 

peacemaker

Expert
Licensed User
Longtime User
I created this topic just for ... maybe is there any idea how to include this technology "under hood" of some our B4X lib\framework, to use without HTML coding, as usual.
 

aeric

Expert
Licensed User
Longtime User
I created this topic just for ... maybe is there any idea how to include this technology "under hood" of some our B4X lib\framework, to use without HTML coding, as usual.
If you like this JS library, you can use it to build your own B4X lib. The community love new libraries. ?
 

EnriqueGonzalez

Expert
Licensed User
Longtime User
Htmx is just amazing, Since i stumbled upon the library i have used it in all my apps. It pairs so perfect with Jserver that seems that it was born with it.
The main pourpose of htmx is to reduce your javascript coding so that means more b4x.

i am huge fan and i would recommend anyone to use it. if you have questions feel free to reach me or post them here.
 

EnriqueGonzalez

Expert
Licensed User
Longtime User
There you are
A simple example i made just in 5 minutes, how to append a row to a table, the important part is that the page is not reloaded. In this simple example it is not important but when you have many things on your webapp you don't want to refresh for every action the user triggers.
 

Attachments

  • htmx_example.zip
    5.2 KB · Views: 177

hatzisn

Expert
Licensed User
Longtime User
There you are
A simple example i made just in 5 minutes, how to append a row to a table, the important part is that the page is not reloaded. In this simple example it is not important but when you have many things on your webapp you don't want to refresh for every action the user triggers.

Thanks for your effort. If someone though is not enough to understand this library I would consider it not accessible to them. :)
 
Last edited:

EnriqueGonzalez

Expert
Licensed User
Longtime User
If someone though is not enough to understand this library I would consider it not accessible to them. :).
i have successfully helped many b4xers getting used to coding webapps with htmx.

If they feel that is not enough to understand what's going on they can always reach me.
 

aeric

Expert
Licensed User
Longtime User
There you are
A simple example i made just in 5 minutes, how to append a row to a table, the important part is that the page is not reloaded. In this simple example it is not important but when you have many things on your webapp you don't want to refresh for every action the user triggers.
I played a while with this sample.
The button inserts the <tr> element after </tbody>. I googled a while and modified to this.

HTML:
<form hx-post="/" hx-target="#content" hx-swap="beforeend">
    <input name="column1" id="column1" type="text">
    <input name="column2" id="column2" type="text">
    <input name="column3" id="column3" type="text">
    <input type="submit" value="send">
</form>

<h2>Appending rows to a Table</h2>
<table id="table">
    <tbody id="content">
    <tr>
      <td>100</td>
      <td>200</td>
      <td>300</td>
    </tr>
    <tr>
      <td>400</td>
      <td>500</td>
      <td>600</td>
    </tr>
    <tr>
      <td>700</td>
      <td>800</td>
      <td>900</td>
    </tr>
  </tbody>
</table>
 

aeric

Expert
Licensed User
Longtime User
With news about creator of Ruby on Rails ditched Typescript, I think it is better to use jQuery or better consider to explore more on HTMX.
 

peacemaker

Expert
Licensed User
Longtime User
I'm just going on to hope for some new B4X lib for HTMX usage from professionals... :)
 
Top