Jump to content

zilav

uniGUI Subscriber
  • Posts

    573
  • Joined

  • Last visited

  • Days Won

    44

Posts posted by zilav

  1. I see what you try to achieve, but remote server taking a snapshot of client browser? Impossible.

    You should make your report as a separate static html page (including google map), save it to a file, and then link it with UniLabel:

     

    <a href="report.html" target="_blank">Print</a>
    

    When user clicks this link, a new tab/window will open with your report and user can print it from browser.

  2. The easiest (but not the best) way is to create a hidden unilabel and store variable in its caption so you can access it in client browser.

    The right way is to create your own "namespace" in javascript globals and store variables there with UniSession.AddJS(), something like this

     

    window.MyVars = window.MyVars || {};
    window.MyVars.Salary = 1000;
    
    ...
    
    function OnClick(sender, e)
    {
     if window.MyVars.Salary < 10000 then ...
    
    

  3. I prefer to keep all visual components in frames, including main frame and login frame.

    When the app starts I just show login frame first and switch to main frame on successful login. You can check MegaDemo how to handle frames.

  4. Endusers will need only browser, all modern report systems work with web. Or you can always write your own report web service. I for example wrote ISAPI module using FastReport that gets template name and parameters from url and generates pdf. So when I need to print anything from my UniGUI apps, I just show an UniLabel with corresponding url, thats it. FastReport Server does exactly the same, but I found it much easier to write my own report server.

  5. PD: I can't upload the files so .. here they are.

    For rendering from TDataSet into TUniImage

    Ok I admit... I was wrong. That is the worst piece of code for web :D

  6. Don't forget to add some random value at the end of url like "image.jpg?3554356756756" so the image won't be loaded from browser's cache the next time it is refreshed.

  7. I have used ShowImage Procedure in my BlobField demo project.

    Jesus people, you are writing for a web browser. Just drop an image file somewhere and link to it with <img src=...> tag, thats all. Browser knows about image formats way more than you.

    That ShowImage procedure is the worst piece of code for web. So much mess for doing so little.

    It's only usefulness is when app needs to work with both web and VCL the same way. If it is not your aim, don't do that.

  8. Time changes so fast... WebSockets technology now is mainstream (as other HTML5 features), supported nearly by all browsers be it mobile or desktop. There are quite a lot of online browser games using it and some interesting js libraries developing steadily

    Socket.IO

    SockJS

    Nice list to check in general.

     

    I don't know if ExtJS4 has anything to do with WebSockets, but adding it's magic to UniGUI can indeed provide some interesting functionality.

  9. Not only MesageDlg, but every other call that stops execution in VCL delphi (ShowMessage, ShowModal, etc) won't pause in UniGUI, so the code like

     

    if MyForm.ShowModal = mrOk then begin
     // do something
    end;
    

    will show a form, but won't wait for a ModalResult and just continue, so "do something" will never be executed. If you want to run a code according to ModalResult, use OnClose event of that form. It is the biggest difference with UniGUI and what caused almost a half of "bug" reports on forum in the past.

  10. If you have some links in HTML that should open other forms, assign js onclick events on them and call AjaxRequest(), catch them in delphi on server side and do what you want.

    If you want to open new forms as a pure html markup, then using unigui is not the best idea. I'd even say its the worst thing to do. Use common LAMP stack for that, or even write CGI/ISAPI in delphi without unigui.

  11. Set mfPage style for MainForm, drop UniHTMLFrame and align to client. Now by altering html code inside frame you have an ordinary WEB site with unigui features.

×
×
  • Create New...