Jump to content

Skyp

uniGUI Subscriber
  • Posts

    75
  • Joined

  • Last visited

Recent Profile Visitors

652 profile views

Skyp's Achievements

Member

Member (2/4)

8

Reputation

  1. The solution does not work. When switching to the last entry in the page, switching occurs (immediately and not when pressing down again). But I corrected this as follows: 1.We add two fields to the grid class (if there are several of them, then for each) (in section private, strict private): TmyClass=class(TUniForm) ... strict private FlastRecNoPrev, FlastRecNoNext: Integer; ... end; 2. We add processing to the onKeyDown - DBGrid event (next code): if ((Sender as TUniDBGrid).WebOptions.Paged) and ((Key = VK_DOWN) or (Key = VK_Up)) then begin if (Key = VK_DOWN) and (((Sender as TUniDBGrid).DataSource.DataSet.RecNo mod (Sender as TUniDBGrid).WebOptions.PageSize) = 0) and (not(Sender as TUniDBGrid).DataSource.DataSet.Eof) then begin if FlastRecNoNext <> (Sender as TUniDBGrid).DataSource.DataSet.RecNo then FlastRecNoNext := (Sender as TUniDBGrid).DataSource.DataSet.RecNo else begin (Sender as TUniDBGrid).DataSource.DataSet.Next; FlastRecNoNext := (Sender as TUniDBGrid).DataSource.DataSet.RecNo; FlastRecNoPrev := FlastRecNoNext; end; end; if (Key = VK_Up) and ((((Sender as TUniDBGrid).DataSource.DataSet.RecNo - 1) mod (Sender as TUniDBGrid).WebOptions.PageSize) = 0) and (not(Sender as TUniDBGrid).DataSource.DataSet.bof) then begin if FlastRecNoPrev <> (Sender as TUniDBGrid).DataSource.DataSet.RecNo then FlastRecNoPrev := (Sender as TUniDBGrid).DataSource.DataSet.RecNo else begin (Sender as TUniDBGrid).DataSource.DataSet.Prior; FlastRecNoPrev := (Sender as TUniDBGrid).DataSource.DataSet.RecNo; FlastRecNoNext := FlastRecNoPrev; end; end; exit; end; 3.We add processing to the onSelectionChange - DBGrid event (code): FlastRecNoNext := (Sender as TUniDBGrid).DataSource.DataSet.RecNo; FlastRecNoPrev := FlastRecNoNext; That's good, thanks for the tip. What should I do with scrolling (mouse scroll -grid)? (when the user scrolls down the page (to the end) and tries to scroll down again, you need to switch the page) *Down - up Example: Again scroll: how to do it?
  2. Hi, everybody. UniDBGrid, with a PageSize:=25 setting in a TDataSet of 50 records Being on the 25th line of the first page and pressing the down button (or scrolling the mouse) I want to get to the next page (the first line). Being on the first line of the 2nd page, pressing the button on the keyboard (or scrolling the mouse) up to get to the last line of the first page. Has anyone done this? (Paging must be enabled - i.e. it's not about infinity scroll)
  3. Yes, it work with files and Opensearch(elasticSearch).
  4. I use it on Linux - in HyperServer StandAlone and it works. I can't say what will happen with ISAPI
  5. I ran into a problem that in version 1.95.0.1576 the WS does not work on the Login form. Of course, this is possible and correct, because the user has not yet logged in, but there are ReceiveSocketsEvents in the form properties, but there is no Delphi event BroadcastMessage(this handler is an illusion, because in fact WS listens only to the frontend and it sends an ajaxRequest to the backend). I have solved this problem (through a crutch😞 1. property form ReceiveSocketsEvents - in True 2. I add in ClientEvents - for event form.socketmesssage it code 3. And added a handler on onAjaxEvent... (with my procedure, here will be your handler) 4. Next.. i add in Delphi Event - OnCreate (LoginForm) call: UniServerModule.WebSocketStack.CreateWebSocket(unisession, self.WebForm); this opens WebSockets in the browser - Ok But if after that you try to log in (and on the main form you will listen to the WS channel) then you will get an error in the browser console: "WebSocket is closed before the connection is established" - https://stackoverflow.com/questions/12487828/what-does-websocket-is-closed-before-the-connection-is-established-mean for Example: Okay not a nice mistake... - We understand that we need to close the connection on the login form (before initializing the main form) because the connection is global... (We go to the JS part of the framework and look at everything in WS) 5. Writing in Delphi class Helper: TUniWebSocketStackHelp = class helper for TUniWebSocketStack public procedure TerminateWS(const aForm: TUniBaseJSForm); procedure CloseWS(const aForm: TUniBaseJSForm); end; //... procedure TUniWebSocketStackHelp.CloseWS(const aForm: TUniBaseJSForm); begin with aForm.JSInterface do begin JSCallGlobal('uniWebSocketObj.closeSocket', []); end; end; procedure TUniWebSocketStackHelp.TerminateWS(const aForm: TUniBaseJSForm); begin with aForm.JSInterface do begin JSCallGlobal('uniWebSocketObj.terminateSocket', []); end; end; 6. Before closing the login form (ModalResult.mrok), we perform: "UniServerModule.WebSocketStack.TerminateWS(self.WebForm);" - I hope this is useful to someone!!
  6. Ok. I Send bigData from WS to front-end (ExtJS) - and I see that I have an error on the child server of the cluster (only there - I have only one) to send big data and bypass the limitations of the 65535 bytes protocol, I split the message into several small ones on the backend and collect them on the frontend.. it for information: UWSHelper.pas (I have written a whole mechanism for transferring large volumes via WS and interrupting executions on the backend if the data is no longer relevant for the front-end (add requestid + for each request)) Everything worked for me in a StandAlone build for Linux and Windows (not HyperServer), on the master (hyperServer), but it did not work on the child node.. I've been looking for a bug in my application for a very long time. Until I went to log hyper_server and saw: I noticed that a couple of minutes after this error appears, hyperServer shuts down.. Log hyper_server: A2023-11-26.log After that, in my UWSHelpers module, I reduced the length of the chunk to 30,000 bytes (CDefMasWsMesSize constant) and everything worked for me (this error is gone).
  7. Good afternoon. Hi, there is a bug with websockets under hyperserver. When I try to send messages about 40,000 bytes long to the master where the websockets server is located, the messages arrive, but on the child node I get an error in the hyperserver logs (this error message occurs only on the child node, the message does not reach the application)- EIdMaxLineLengthExceeded. The cluster is configured for Linux. Unigui version 1.95.0.1575
  8. Hi. You may use simple Writeln or QuickLog with console provider: https://github.com/exilon/QuickLogger it's simple. try it)
  9. Hi. Does this mean what is included in the plan for upcoming releases? Under Linux this is the only such global problem - this problem also extends to radcore... Step by step -(
  10. Hi. Not long ago I gave a detailed answer on connecting to a DBMS and working with connection: (it example) remember one connection can only return one set of data at a time, use a connection pool
  11. To measure performance on the server side please use TStopWatch - system.diagnostics. You can view the speed and data download flows in the browser console (Network tab). Maybe it will help...in the mainmodule there is a handleRequest event which receives (see unigui Demos (Request log)) the component identifier and the name of the method from ajaxRequest (there you can also get a pointer to the component on the server and compare the Click(js)-onClick events (Delphi )).
  12. Привет. Пожалуйста, смотрите File on server. If we are talking about files on the client (not on the server), then unfortunately browsers hide the source paths (on default ) (from the dialog) - https://stackoverflow.com/questions/4851595/why-do-browsers-present-selected-files-as-coming-from-c-fakepath-instead-of-th this solution is just a crutch until the loopholes are closed
×
×
  • Create New...