Jump to content

estrify

uniGUI Subscriber
  • Posts

    454
  • Joined

  • Last visited

  • Days Won

    14

Everything posted by estrify

  1. Hi everyone, I am extending TUniForm with some custom properties. I can use those properties by code in derived forms with no problem. The problem appears when I try to view those properties in the object inspector to do some configuration at design time. To do so, I register the custom form with RegisterCustomModule. So when I derive a form from this custom one, the custom properties appear in the object inspector, but I can't compile this derived form. Obviously I'm doing something wrong. So, can anyone help on how to achieve this? Best regards,
  2. Hi, In case anyone is interested, I have found that the following approach would solve the problem: procedure TMyUniPanel.WebCreate; begin inherited; ClientEvents.UniEvents.Values['beforeInit'] := 'function beforeInit(sender, config){ '+ 'sender._log = sender._log ?? "" + "\nUniEvents-beforeInit"; '+ '}'; ClientEvents.UniEvents.Values['afterCreate'] := 'function afterCreate(sender, config){ '+ 'sender.on("beforerender", function(sender, eOpts){ '+ ' sender._log = sender._log + "\nExtEvents-beforerender"; '+ '}); '+ '}'; end; Best regards,
  3. Hi @Sherzod, Thanks for response, but I'm afraid I didn't explain myself well. Let me try to explain it better: I am developing a component: type TMyUniPanel = class(TUniPanel) ... And I have something like this: procedure TMyUniPanel.WebCreate; begin inherited; ClientEvents.ExtEvents.Values['beforerender'] := 'function beforerender(sender, eOpts){ sender._log = sender._log ?? "" + "\nExtEvents-beforerender"; }'; ClientEvents.UniEvents.Values['beforeInit'] := 'function beforeInit(sender, config){ sender._log = sender._log ?? "" + "\nUniEvents-beforeInit"; }'; end; Now, when I want to use this component in a form, inserting it and performing the following: UniSession.AddJS('alert('+MyUniPanel1.JSName+'._log);'); the result is "UniEvents-beforeInit" and not both "ExtEvents-beforerender" and "UniEvents-beforeInit". That is, “beforerender” has not been executed. So, when developing a component, where is the most suitable point to assign code to ClientEvents.ExtEvents.Values['beforerender']? Best regards,
  4. Dear @Sherzod, I am creating a custom component that descends from TUniPanel. For this new compnent, I need to set ClientEvents.ExtEvents and ClientEvents.UniEvents. I can set some ClientEvents.ExtEvents inside LoadCompleted, but I can't with ClientEvents.UniEvents (specifically, "beforeInit"). Where do I have to do this?... If I set it inside WebCreate, there is no effect... If I set it inside the constructor, this will insert the new panel with the hardcoded javascript in design mode, so if I change the javascript in the component source, I have to remove all the panels and insert them again throughout the project, for what this is unacceptable. So where is the most suitable point to do this? Sincerely,
  5. estrify

    Using TLS 1.3

    I should have skipped that detail in the documentation. Sorry for the inconvenience. Thank you so much.
  6. estrify

    Using TLS 1.3

    Dear @Farshad Mohajeri Even using TLS 1.2, our security department is after me to solve a vulnerability that has to do with weak ciphers that could be used. To do this, I have to modify UniServerModule.SSL.SSLOptions.CipherList to specify which ciphers are allowed. The question is, since I have to do this inside "UniGUIServerModuleCreate", it will run properly in standalone or service mode, but will it do so using hyperserver?. If the latter is no, please add the possibility to specify this parameter in the "hyper_server.ssl.cfg" file. Kind regards,
  7. I sincerely hope that the entire team and their families are safe and that those affected can recover soon from this catastrophe.
  8. Dear @Sherzod, I think I have found a possible solution. It combines respnsiveConfig where no additional variables are needed, and old-way javascript code where they are needed. But all the responsiveness is done on the client side. I am sure you can find a more elegant solution. Anyway, this one seems to work. Best regards, P.D. I think it's very interesting for all users to include some kind of demo like this test case inside UniGUI. Of course you can use this test case as you like if you find it interesting in any way. UniGUI_MainForm_JavaScript.zip
  9. Ok, here is the same idea I attached before but applied to this case... I hope this helps you... Suggestion: if you're testing, apply colors to your container's panels to see the effects of resizing. Best regards, TestCase (one possibility 2).zip
  10. Hi @Sherzod, Thanks for answering. I'm afraid I can't adopt this solution in this project... To give you an idea of what this new project imposes: The logic behind responsiveness is not considered "business logic" so it cannot be implemented on the server side. I had to do it entirely on the client side. The logic behind "actions", i.e. clicking on items, is considered "business logic", so this code MUST be server-side. So if the ExtJS responsive solution can't do that, I have to solve it directly with pure JavaScript. So thanks again for the help and if you find a way to make it work the way I need, please let me know. Best regards,
  11. There are several ways to achieve... Here I attach another one, using only layout attributes with RAD... TestCase (one possibility).zip
  12. Hi @Sherzod, The server side logic is in the main.pas (TMainForm.UniLabel1Click)... What has to be added to this procedure to update the layout, forcing the re-evaluation of the responsiveConfig?...
  13. Hi @Sherzod, It's probably very simple, but I can't figure it out, so I'll really appreciate your help... I attach a simple case of how is implemented the responsiveConfig feature. (Please, look into beforeInit function of the pnlLeft panel)... If you run the test case, when you resize your browser, as usual, you can see different configurations for size 1, size 2, size 3 and go on. Size 1 doesn't show a blue column. Now, click over "Showing Normal" to switch to "Showing Column At Least": (1) if you are in size 2, 3 or 4, when you resize to size 1, you will see that this size now is showing a blue column when before it did not, so everything is working ok (2) but if you are in size 1, the column is not shown until a resize event is fired So, how can I update the layout in (2) to force the re-evaluation of the responsiveConfig without making a resize and only with client side code? UniGUI_MainForm_ResponsiveConfig.zip
  14. Dear @Sherzod, A simple project with "MainFormDisplay=mfPage", the MainForm has a simple panel that has the classic ExtJS's responsiveConfig idea: function beforeInit(sender, config) … config.responsiveConfig = { 'condition 1': { hidden: true }, 'condition 2': { hidden: false, width: 45 }, 'condition 3': { hidden: false, width: 250 } … This works great when the MainForm is resized, so that's fine. But, 1. Is there a way to evaluate this "responsiveConfig" with other events, not just on resize? 2. Or, how can I simulate a resize event to force the evaluation of the corresponding "responsiveConfig"? I've tried calling "updateLayout" for both the panel and the MainForm, but without success. How can I do that? Thanks in advance,
  15. Please take a look to the post where I tried to explain the need for a grid that works in a different way, to be able to do things similar to what other professional products do… Regards,
  16. Thanks for the suggestions but I'm afraid my level of English is so bad that they don't understand me. Let's start again, this time with a list: I don't usually have problems with large data sets because I use profiles, different views, filters, exports, etc. I told you our numbers so you can see that it is very easy to generate a situation with huge records. Only that. So, in some cases, even with all this, a large data set is generated. I did a test with UniGUI and a similar huge dataset in our Salesforce. Salesforce's grid ALWAYS starts displaying the grid in 2-3 seconds. UniGUI grid needs 25-35 seconds. After researching how they can do that, I changed the classic UniGUI gird way of working, making my own paging system and "voilà", the "new conceptual" grid now starts displaying data in 2-3 seconds. This is why I say that UNIGUI does not work well with large data sets. This solution is very fast, and has its own problems and limitations, including the loss of many DBGrid functionalities (infinite scrolling, paging, filters, etc.). This is what I tried to convey to the UniGUI team when I said "what I need", but I see that it has not been understood. I simply trying to explain the need to have a different type of grid for specific cases. Btw, this issue is not specific to UniGUI. The same test in VCL gets similar results, because the main problem is the transfer of information from the database server to the unigui server and the creation of the data set in the latter. Hoping it's clearer now. Regards,
  17. Thank you very much... Please, pay attention to the first point, which is where the most of wasted time (transferring the complete data set over the network): "I think the normal sequence in a UniGUI project is the following: 1. MySQL Server executes the query and returns it to UniGUI server. As I can only use client side cursors with UniGUI controls, this huge amount of data travels from MySQL to UniGUI servers, consuming network resources and time. 2. UniGUI server sends much less amount of data to UniGUI client with a tipical paged DBGrid, so this is done quickly. Filters and sorters of a DBGrid manage temporarily stored data in UniGUI server, so those operations are very fast. "
  18. This is exactly what I do in those cases... What I was trying to tell is that unigui does not know how to optimize communication between database server and UniGUI server for grids when their datasets are very large (as, for example, Salesforce does) ... We all know that no one is going to look in detail into a dataset of 300,000 lines (not even 2000), but the unigui server does not know how to paginate without having the complete dataset, and the problem (for me) is the transferring time that this operation needs. This is what I need to do to simulate what Salesforce does: "To create a custom system to replace a large handful of very useful features of UniGUI's DBGrid: pagination/infinite scrolling, grid filters and sorters. That is, using a DBGrid without paging and implement a totally new paging system doing "SELECT COUNT()" to retrieve the number of rows, use my own controls to do pagination and link it to SQL's "LIMIT OFFSET, ROWS" to retrieve only one desired page. And, obviously, disable all client side filtering and sorting and replacing it with server side filtering and sorting. "
  19. Hahahaha ... As you like ... As I said, only have this issue in very specific moments, when the wonderful design cannot be adjusted to what is requested. Hopefully, you will never have that problem, but the fact is UniGUI grid is far from knowing how to handle large datasets as our Salesforce does. It's possible, of course, but I have to build this kind of grid.
  20. Hi, Please, don't take it as a joke. Depending on the project, it is a more common problem than you might think (may be not with 8 millons records 🙂) In our case, we have tens of millions of installation points, hundreds of thousands of them, we have to migrate their technology between this year and the next, with millions of service control records with its sales, objectives, offers and opportunities. A given operator profile may see a grid with only a few hundred records, but his boss sees a few thousands, and his boss's boss several hundreds thousands, and so on. Thank goodness most high-profile users prefer to see executive summaries, but even so, it's very easy for a given grid to occasionally end up receiving many, many records. Filters initially help keeping record counts "relatively" low, but the problem is that those filters get altered simply because, for example, a manager is seaching for some kind of anomaly affecting hundreds of thousands of installations of which he is responsible. So, the database is our most important tool and its designs is simply critical. In UniGUI, I usually solve the problem by designing different views depending on the profile (usually need about 3 or 4 profile views for a simple project), but it is not the first nor the last time that a profile insists / needs to see the same data as his subordinates, and UniGUI is simply is not ready for it yet. I asked for advice a time ago but without results. Regards,
  21. Hi, One possible solution (with EnableSynchronousOperations=False) : ... private { Private declarations } AllowClose_UniTabSheet3: Boolean; ... procedure TMainForm.UniTabSheet3BeforeFirstActivate(Sender: TObject; var AllowActivate: Boolean); begin AllowClose_UniTabSheet3:=False; end; procedure TMainForm.UniTabSheet3Close(Sender: TObject; var AllowClose: Boolean); begin AllowClose:=AllowClose_UniTabSheet3; if not AllowClose_UniTabSheet3 then begin MessageDlg('Close?', TMsgDlgType.mtInformation, mbYesNo, procedure(Sender: TComponent; Res: Integer) begin if Res=mrYes then begin AllowClose_UniTabSheet3:=true; UniTabSheet3.Close(); end; end ); end; end; Regards,
  22. Hi, try with UniDBGrid1.SelectedRows.Count Regards,
  23. You're welcome... Be careful with UniGUI's access control to files. Don't assume anything: i.e. if you put the file into your bin directory, you can still access it with https://localhost/test.txt or https://localhost/files/../test.txt 😱
  24. Hi, I think it is related with file extension... Rename the file to .txt and you will see how UniGUI will serve it.
×
×
  • Create New...