Closed fastbike closed 1 year ago
Some examples
// first param is an enum of types of substitution, second is to scroll or directly show, third is at top or bottom
Context.Response.SetReswap(soInnerHTML, ssScroll, sstBottom);
Context.Response.TriggerClientEvents('myEvent');
// trigger two events, or more) to be called sequentially
Context.Response.TriggerClientEvents(['myEvent', 'myEvent2']);
var
Facility: TFacility;
// code to create and populate the object goes here
...
// send it to the web page
Context.Response.TriggerClientEvent('savedEvent', Facility);
Nice. What you could do is to create a sample project which uses these helpers. Then we can put the sample in the official samples. This could be also a showcase about using HTMX with dmvcframework.
Cool, I'll add it to my todo list :)
I've created a simple CRUDS style app showing a list of movies, which shows how to incorporate HTMX into Delphi MVC Framework. Where shall I upload the zip file to ?
Hi, just send me the zip "d (dot) teti (at) bittime (dot) it" and I'll add it to the repo. Otherwise you can create a PR.
Thanks
DT
Il dom 3 set 2023, 03:14 David Moorhouse @.***> ha scritto:
I've created a simple CRUDS style app showing a list of movies, which shows how to incorporate HTMX into Delphi MVC Framework. Where shall I upload the zip file to ?
— Reply to this email directly, view it on GitHub https://github.com/danieleteti/delphimvcframework/issues/686#issuecomment-1703978588, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAK4ZJCQQICQ2QVMM5YGRD3XYPKY3ANCNFSM6AAAAAA4FA64HA . You are receiving this because you commented.Message ID: @.***>
Pull request created
I've been playing around with HTMX (https://htmx.org/) a light weight hypertext first web framework that uses server side rendering which reduces the amount of javascript code in an app by a large factor.
Other languages have helper classes for HTMX to work with HTTP request and response objects. I've written some code as class helpers for the DMVC TMVCWebRequest and TMVCWebResponse frameworks that encapsulate the server side aspects and wondering whether they could be added to the library ? Anyway here's the public interface, with some examples how they get used in the DMVC controller code.
(As an aside, porting this code over from scripting type languages gave me more appreciation for the strongly typed nature of Pascal - where I could declare types for the various arguments to make it easier for application writers, the php implementation had to check the spelling of the argument and then raised an error if it was not within the allowed values. Which complicates their code and makes it a second class experience for the application writer !)