Jump to content

Skyp

uniGUI Subscriber
  • Posts

    75
  • Joined

  • Last visited

Everything posted by Skyp

  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
  13. It feels like the margins on the bottom and right are not considered correctly, and if somewhere I add 5 on the right and everything will be clearly visible (the same srollbar), and somewhere 20 so that it is also visible
  14. Hi. I tested it on version 1573. It got better, but it still doesn't work correctly: I have highlighted the problem areas in the alignmen (align,margins)... Windows 10/RHEL 8.5 Example (source) Project2.rar Windows good, Linux bad
  15. I answer for information (for everyone): It will work if - For each session, create a separate monitor instance(example in mainmodule)(a unique log file) (for connections used by this session). Create connection: 1. If you are trying to create a single pool of connections (fd, unidac - the pool code already has synchronization methods) per process, then you need to unbind the connections from the owner Connection.Create(nil) and control the life cycle of connections and dependent components yourself.. 2. If you are not ready to resort to such control, then create connections + pool(a pull will be created for each session.. it bad..) for each session in the mainmodule address space.... and in the case of using Task, Threads within a unigui session, you will have to wrap the constructor and destructor in a monitor: lcmpown:= con.owner; if assigned(lcmpown) then begin Tmonitor.enter(lcmpown); freeandnil(con); tmonitor.exit(lcmpown); end; this is due to the operation of notifications and mechanisms for creating and clearing components. both options imply SQL monitor for session (in mainmodule)
  16. Привет. Странный запрос... Если Вам постоянно нужна эта таблица, то почему не использовать постоянную сущность?
  17. Our company already has the development of GUI applications for Android, development for Linux (fmxLinux) is being prepared, I am putting together unigui projects for RHEL and Astra, at first glance it looks more complicated and you catch SegFault and similar errors, over time, withstanding the requirements of Linux, you get used to everything and it looks ok. There are no bad instruments, there are people who do not yet know how to prepare them-)
  18. Hi... maybe this is not a cool mechanism, but it could be very useful for people who do not know JS.. on problem .. (this is not a problem, but a limitation) - There are extensions for the browser that allow you to remove these restrictions, and on the js side there seem to be solutions for tracking the status of file downloads.... Maybe it’s worth adding an option that would allow more than 5 files to be downloaded at the same time (despite the limitations of the browser, it won’t allow this will give), stand in line or use the limited option. What do you say?
  19. Good afternoon. Probably misunderstood, while the code is running on the backend, this mask works. Ie, the code has already worked on the backend, but there is no render in the browser, and while the browser renders, a white screen is visible.
  20. Hi. How to close the process of loading the main form with a mask (for some time 1-4 seconds (from client communication..) there may be a white screen between the authorization form and the MainForm. How to call a mask on the body? Is there even a way to manage the application body without resorting to js?
×
×
  • Create New...