Re: [Lazarus] db grid/dataset components that only load currently visible records?

2023-02-23 Thread Luca Olivetti via lazarus

El 23/2/23 a les 17:16, Michael Van Canneyt ha escrit:


Even if such a component existed, I don't think it would fit my use-case.


Why do you think so ? Paging is exactly what you want to do.


Not exactly, I mean, yes, it is paging but it has to be "transparent", I 
don't want to add  "previous page" and "next page" buttons.


Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] db grid/dataset components that only load currently visible records?

2023-02-23 Thread Michael Van Canneyt via lazarus




On Thu, 23 Feb 2023, Luca Olivetti via lazarus wrote:


El 23/2/23 a les 13:52, Michael Van Canneyt via lazarus ha escrit:



On Thu, 23 Feb 2023, Luca Olivetti via lazarus wrote:


El 23/2/23 a les 11:11, Michael Van Canneyt via lazarus ha escrit:
But IMO: in the first place you should ask yourself if displaying 10.000 
records is

what you actually want to do.


No, I just need to display 20 or so records, the problem is I'd like the 
user to be able to scroll over the whole table, so I'd have to hook a lot 
of events in the TDBGrid (if that's even possible, otherwise I'd have to 
implement a replacement) and get rid of the TDBNavigator and implement a 
custom one in its place.


The LCL could do with a pager component. Seems to be standard when Web 
pages

display grids/tables, so users should be used to it :-)


Even if such a component existed, I don't think it would fit my use-case.


Why do you think so ? Paging is exactly what you want to do.

Maybe I should just write a TDataset descendant tailor made for this 
application, any pointer on how to write a minimal descendant?
I'm looking at the TMemDataset implementation as an example, is it a good 
one?


As good as any other.

The idea is to substitute open and scrolling (next/prior/locate/etc.) with 
the appropriate sql statements to just retrieve a small buffer of data around 
the current record (I can do that easily enough), though I'm not sure that 
would be enough to fool the TDBGrid.


I don't know what the grid exactly does, so I cannot advise.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] db grid/dataset components that only load currently visible records?

2023-02-23 Thread Luca Olivetti via lazarus

El 23/2/23 a les 13:52, Michael Van Canneyt via lazarus ha escrit:



On Thu, 23 Feb 2023, Luca Olivetti via lazarus wrote:


El 23/2/23 a les 11:11, Michael Van Canneyt via lazarus ha escrit:
But IMO: in the first place you should ask yourself if displaying 
10.000 records is

what you actually want to do.


No, I just need to display 20 or so records, the problem is I'd like 
the user to be able to scroll over the whole table, so I'd have to 
hook a lot of events in the TDBGrid (if that's even possible, 
otherwise I'd have to implement a replacement) and get rid of the 
TDBNavigator and implement a custom one in its place.


The LCL could do with a pager component. Seems to be standard when Web 
pages

display grids/tables, so users should be used to it :-)


Even if such a component existed, I don't think it would fit my use-case.

Maybe I should just write a TDataset descendant tailor made for this 
application, any pointer on how to write a minimal descendant?
I'm looking at the TMemDataset implementation as an example, is it a 
good one?
The idea is to substitute open and scrolling (next/prior/locate/etc.) 
with the appropriate sql statements to just retrieve a small buffer of 
data around the current record (I can do that easily enough), though I'm 
not sure that would be enough to fool the TDBGrid.


Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] db grid/dataset components that only load currently visible records?

2023-02-23 Thread Michael Van Canneyt via lazarus




On Thu, 23 Feb 2023, Luca Olivetti via lazarus wrote:


El 23/2/23 a les 11:11, Michael Van Canneyt via lazarus ha escrit:
But IMO: in the first place you should ask yourself if displaying 10.000 
records is

what you actually want to do.


No, I just need to display 20 or so records, the problem is I'd like the user 
to be able to scroll over the whole table, so I'd have to hook a lot of 
events in the TDBGrid (if that's even possible, otherwise I'd have to 
implement a replacement) and get rid of the TDBNavigator and implement a 
custom one in its place.


The LCL could do with a pager component. Seems to be standard when Web pages
display grids/tables, so users should be used to it :-)

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] db grid/dataset components that only load currently visible records?

2023-02-23 Thread Luca Olivetti via lazarus

El 23/2/23 a les 12:24, Jean SUZINEAU via lazarus ha escrit:

Le 23/02/2023 à 11:37, Luca Olivetti via lazarus a écrit :
No, that's not possible, in any case polling isn't a problem: it's the 
same application that modifies the table, and it only does the 
"refresh" when necessary.
That's exactly a use case for my orm ( 
https://github.com/jsuzineau/pascal_o_r_mapping/tree/TjsDataContexte )

It's working with the Observer design pattern, no need to poll


Thank you, but from a quick look it doesn't seem to solve the problem at 
hand.


Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] db grid/dataset components that only load currently visible records?

2023-02-23 Thread Jean SUZINEAU via lazarus

Le 23/02/2023 à 11:37, Luca Olivetti via lazarus a écrit :
No, that's not possible, in any case polling isn't a problem: it's the 
same application that modifies the table, and it only does the 
"refresh" when necessary.
That's exactly a use case for my orm ( 
https://github.com/jsuzineau/pascal_o_r_mapping/tree/TjsDataContexte )

It's working with the Observer design pattern, no need to poll

Unfortunately, I don't have written any documentation.

It works with SQLite, there is even a source code generator that can 
create all the boiler plate code from the SQLite database. All the 
templates of the source code generator can be customized.


Two of my last releases that uses this orm:

https://github.com/jsuzineau/pascal_o_r_mapping/releases/tag/2023_02_20_jsWorks

https://github.com/jsuzineau/pascal_o_r_mapping/releases/tag/2023_02_17_jsCompta

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Screwed up Lazarus installation - how to make clean and start over?

2023-02-23 Thread Mattias Gaertner via lazarus
On Thu, 23 Feb 2023 11:48:06 +0100
Bo Berglund via lazarus  wrote:

>[...]
> Next I went there again to do the rebuild, but now the button is no
> longer enabled :-(
> 
> But I found another in Tools/Build Lazarus with profile Normal IDE
> If I use that will it do the same as the button you referred to?

Yes.
 
Mattias
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Pas2JS_Widget international characters issue

2023-02-23 Thread Mgr. Janusz Chmiel via lazarus
Dear elite Lazarus and Pas2js developers,Please, could someone from this kind and polite community try to find The cause of The following issue? I Am using Pas2JS_Widget because it allow Me to create GUI of WEB apps professionally even with screen reader support.I Am using The Components tree to choose AN GUi object and I simply press Enter. In this case, The component is placed automatically to The form. So only sighted friend would had to tune The positioning of every GUI element on The form. But screen reader read The textual content perfectly even if for example only one component is actually being visible On The real screen. But unfortunately, Czech characters are displaied incorrectly.When using Lazarus and when I using F2 key in The form designer to set some textual content to The GUi elements. I Am using The following package.https://github.com/pascaldragon/Pas2JS_Widget Please, how complex would be to repair this package so Czech characters could be displaied normály. Thank you very much for your support and help.With The deepest possible appreciation and with The warmest regards.Janusz Chmiel
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Screwed up Lazarus installation - how to make clean and start over?

2023-02-23 Thread Bo Berglund via lazarus
On Wed, 22 Feb 2023 22:59:15 +0100, Werner Pamler via lazarus
 wrote:

>You uninstall a package in the "Package" > "Install/Uninstall packages" 
>dialog. Select the package to be removed in the left list, click 
>"Uninstall selection" and then "Save and Rebuild IDE".

I did the "Uninstall selection" OK but then I decided to go look for something
else so I did not use the rebuild button.

Next I went there again to do the rebuild, but now the button is no longer
enabled :-(

But I found another in Tools/Build Lazarus with profile Normal IDE
If I use that will it do the same as the button you referred to?


>This will remove bglcontrols which is a runtime/designtime package, but 
>it will not remove bgrabitmappack - it is a runtime package and thus is 
>not compiled into the IDE. This cannot crash the compilation of the IDE. 
>If you also want to get rid of it, go to "Package" > "Package Links", 
>find it in the list, check it and click "Delete selected". This removes 
>the path to the package from an internal list so that the IDE no longer 
>knows where the package is (the files are still there, though - but you 
>can delete them manually in the OS).

I will remove the package folders below pcp dir onlinepackagemanager for these
packages.

-- 
Bo Berglund
Developer in Sweden

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TFPHTTPServer

2023-02-23 Thread duilio foschi via lazarus
that was it. Thanks a lot

Peppe

On Thu, Feb 23, 2023 at 11:07 AM Michael Van Canneyt via lazarus
 wrote:
>
>
>
> On Thu, 23 Feb 2023, duilio foschi via lazarus wrote:
>
> > I wrote a simple server using TFPHTTPServer.
> >
> > All incoming calls are processed using
> > procedure HandleRequest(var ARequest: TFPHTTPConnectionRequest;
> > var AResponse: TFPHTTPConnectionResponse);
> >
> > My first tests were ok and encouraging but... how do I know if the
> > call was a GET or a POST?
> >
> > I guess that ARequest "knows" it, but I cannot find a way to ask :)
>
> Try ARequest.Method, this is the HTTP method string as sent by the client.
>
> Michael.
> --
> ___
> lazarus mailing list
> lazarus@lists.lazarus-ide.org
> https://lists.lazarus-ide.org/listinfo/lazarus
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] db grid/dataset components that only load currently visible records?

2023-02-23 Thread Luca Olivetti via lazarus

El 23/2/23 a les 11:25, Marco van de Voort via lazarus ha escrit:

Maybe upgrade to a DBMS (like firebird, mssql,postgres) that supports 
notifications so that you don't have to poll, but get a notification if 
something changes?


No, that's not possible, in any case polling isn't a problem: it's the 
same application that modifies the table, and it only does the "refresh" 
when necessary.
The problem is that it happens quite frequently (mind me, in a test 
environment, in the field the updates happen once or twice a minute, but 
I'm still not comfortable with the refresh taking too long).


Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] db grid/dataset components that only load currently visible records?

2023-02-23 Thread Luca Olivetti via lazarus

El 23/2/23 a les 11:11, Michael Van Canneyt via lazarus ha escrit:
But IMO: in the first place you should ask yourself if displaying 10.000 
records is

what you actually want to do.


No, I just need to display 20 or so records, the problem is I'd like the 
user to be able to scroll over the whole table, so I'd have to hook a 
lot of events in the TDBGrid (if that's even possible, otherwise I'd 
have to implement a replacement) and get rid of the TDBNavigator and 
implement a custom one in its place.



Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] db grid/dataset components that only load currently visible records?

2023-02-23 Thread Marco van de Voort via lazarus



On 23-2-2023 11:02, Luca Olivetti via lazarus wrote:


OTOH a TDBGrid is a very convenient way to display data.
I my application I just use it to display (in read-only mode) an 
sqlite table that holds less than 1000 records and it could be updated 
quite frequently (hence the need for the frequent TDataset.refresh), 
and it works fast enough with that limited amount of records.
Now I need to expand the table to 1 records and the performance is 
unacceptable.


Maybe upgrade to a DBMS (like firebird, mssql,postgres) that supports 
notifications so that you don't have to poll, but get a notification if 
something changes?

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] db grid/dataset components that only load currently visible records?

2023-02-23 Thread Michael Van Canneyt via lazarus



On Thu, 23 Feb 2023, Luca Olivetti via lazarus wrote:


El 23/2/23 a les 9:43, Michael Van Canneyt via lazarus ha escrit:






Something like this:



https://docwiki.embarcadero.com/RADStudio/Rio/en/Browsing_Tables_(FireDAC)#Live_Data_Window_Mode


This is not something that the grid handles. This is a dataset feature.


Yes, I supposed so



At this moment I know of no FPC/Lazarus dataset component that handles 
this automatically.


bummer :-(


Note the remark on that page:

"Although FireDAC minimizes the number of generated and executed SQL 
commands in LDW mode,
  it still produces a heavier DB load than TFDQuery. So, application 
developers should

  carefully choose when to use TFDTable and LDW mode. "

This is exactly why FPC does not have a database table component. It's 
horribly inefficient.


OTOH a TDBGrid is a very convenient way to display data.
I my application I just use it to display (in read-only mode) an sqlite 
table that holds less than 1000 records and it could be updated quite 
frequently (hence the need for the frequent TDataset.refresh), and it 
works fast enough with that limited amount of records.
Now I need to expand the table to 1 records and the performance is 
unacceptable.


The best way is to use "limit N offset M" in your query and use a paging
mechanism. Make sure you sort the records, obviously.

But IMO: 
in the first place you should ask yourself if displaying 10.000 records is

what you actually want to do.

Maybe your application is better off with some filtering ?

Michael.-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TFPHTTPServer

2023-02-23 Thread Michael Van Canneyt via lazarus




On Thu, 23 Feb 2023, duilio foschi via lazarus wrote:


I wrote a simple server using TFPHTTPServer.

All incoming calls are processed using
procedure HandleRequest(var ARequest: TFPHTTPConnectionRequest;
var AResponse: TFPHTTPConnectionResponse);

My first tests were ok and encouraging but... how do I know if the
call was a GET or a POST?

I guess that ARequest "knows" it, but I cannot find a way to ask :)


Try ARequest.Method, this is the HTTP method string as sent by the client.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] db grid/dataset components that only load currently visible records?

2023-02-23 Thread Luca Olivetti via lazarus

El 23/2/23 a les 9:43, Michael Van Canneyt via lazarus ha escrit:






Something like this:

https://docwiki.embarcadero.com/RADStudio/Rio/en/Browsing_Tables_(FireDAC)#Live_Data_Window_Mode


This is not something that the grid handles. This is a dataset feature.


Yes, I supposed so



At this moment I know of no FPC/Lazarus dataset component that handles 
this automatically.


bummer :-(


Note the remark on that page:

"Although FireDAC minimizes the number of generated and executed SQL 
commands in LDW mode,
  it still produces a heavier DB load than TFDQuery. So, application 
developers should

  carefully choose when to use TFDTable and LDW mode. "

This is exactly why FPC does not have a database table component. It's 
horribly inefficient.


OTOH a TDBGrid is a very convenient way to display data.
I my application I just use it to display (in read-only mode) an sqlite 
table that holds less than 1000 records and it could be updated quite 
frequently (hence the need for the frequent TDataset.refresh), and it 
works fast enough with that limited amount of records.
Now I need to expand the table to 1 records and the performance is 
unacceptable.


Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] TFPHTTPServer

2023-02-23 Thread duilio foschi via lazarus
I wrote a simple server using TFPHTTPServer.

All incoming calls are processed using
procedure HandleRequest(var ARequest: TFPHTTPConnectionRequest;
 var AResponse: TFPHTTPConnectionResponse);

My first tests were ok and encouraging but... how do I know if the
call was a GET or a POST?

I guess that ARequest "knows" it, but I cannot find a way to ask :)

Thank you

Peppe Polpo
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] db grid/dataset components that only load currently visible records?

2023-02-23 Thread Jean SUZINEAU via lazarus

May be making a custom component based on VirtualTreeView ?
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] db grid/dataset components that only load currently visible records?

2023-02-23 Thread Michael Van Canneyt via lazarus




On Thu, 23 Feb 2023, Luca Olivetti via lazarus wrote:


El 23/2/23 a les 9:04, Luca Olivetti via lazarus ha escrit:

Hello,

do you know of any component/dataset combo that works like a TDBGrid but 
doesn't load all the records from the db when doing a refresh, just the 
ones that are currently visible, yet offering seamless scrolling?

I looked in the wiki but I couldn't find any.


Something like this:

https://docwiki.embarcadero.com/RADStudio/Rio/en/Browsing_Tables_(FireDAC)#Live_Data_Window_Mode


This is not something that the grid handles. This is a dataset feature.

At this moment I know of no FPC/Lazarus dataset component that handles this 
automatically.

Note the remark on that page:

"Although FireDAC minimizes the number of generated and executed SQL commands 
in LDW mode,
 it still produces a heavier DB load than TFDQuery. So, application developers 
should
 carefully choose when to use TFDTable and LDW mode. "

This is exactly why FPC does not have a database table component. 
It's horribly inefficient.


Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] db grid/dataset components that only load currently visible records?

2023-02-23 Thread Luca Olivetti via lazarus

El 23/2/23 a les 9:04, Luca Olivetti via lazarus ha escrit:

Hello,

do you know of any component/dataset combo that works like a TDBGrid but 
doesn't load all the records from the db when doing a refresh, just the 
ones that are currently visible, yet offering seamless scrolling?

I looked in the wiki but I couldn't find any.


Something like this:

https://docwiki.embarcadero.com/RADStudio/Rio/en/Browsing_Tables_(FireDAC)#Live_Data_Window_Mode

Bye

--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] db grid/dataset components that only load currently visible records?

2023-02-23 Thread Luca Olivetti via lazarus

Hello,

do you know of any component/dataset combo that works like a TDBGrid but 
doesn't load all the records from the db when doing a refresh, just the 
ones that are currently visible, yet offering seamless scrolling?

I looked in the wiki but I couldn't find any.

Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus