Jump to content

estrify

uniGUI Subscriber
  • Posts

    454
  • Joined

  • Last visited

  • Days Won

    14

estrify last won the day on April 20 2023

estrify had the most liked content!

Recent Profile Visitors

3797 profile views

estrify's Achievements

Advanced Member

Advanced Member (4/4)

77

Reputation

  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,
×
×
  • Create New...