Jump to content

zilav

uniGUI Subscriber
  • Posts

    573
  • Joined

  • Last visited

  • Days Won

    43

Posts posted by zilav

  1. First, don't use direct queries especially in SQL Server.

    Create stored procedure with filtering parameters, your Delphi client will be calling it

    exec sp_proc1 :PRO_RAZAO_SOCIAL, :LOG_UF, :LOG_CIDADE

     

    Test in Manager Studio with some parameters and make sure it returns data, then pass the same params from Delphi. Your issue is probably caused by wrong parameters you are trying to filter with, not because of UniGui. Since you are using LIKE, maybe you forgot to prepend or append % depeding on how you want to match the data.

  2. 1. That's my exact approach. All logic is performed in stored procedures on server including verification of input parameters (user's input), UniGUI app is just an empty UI shell calling stored procs and catching returned exceptions to show error messages to the users, it doesn't have a single SQL request. Since UniGUI is stateful and you can't update your code without restarting it and thus interrupting work of all currently connected users, this is the best approach as it allows a lot of flexibility and seemless updating just by working with DB server.

     

    2. "Client memory" doesn't exist in UniGUI, all sessions and data are stored in the server's memory and web browser is simply a canvas to display the current state like RDP. MainModule is per session (user), dynamically created when each user connects and destroyed when disconnects. ServerModule is a single instance created when you launch UniGUI app. Never put your data on ServerModule or you'll have concurrency issues.

    • Upvote 2
  3. Thanks YuriO, zilav, delphidude,

    I'll check that URL parameter and possible problem with creating a new session.

    I like zilav method to find current session if it is opened.

    I'll try, regards.

    It all depends on the architecture of your application. If you can restore state using URL parameters on start, then the delphidude's method is preferable since it doesn't keep Uni session open and frees server resources.

  4. This will create a new session which is undesirable I think in this case.

    I guess the best approach is to get the current SessionID, forge an URL with it and start external web serivce in UniURLFrame passing URL as a parameter I guess (not mentioned how URL is supposed to be passed). At that point put your app in a waiting state and start UniTimer to check some variable in MainModule of the current session.

    Meanwhile in ServerModule.OnHTTPCommand process the incoming requests, iterate over the sessions list and find your session by provided SessionID in URL, and set variable your UniTimer is waiting for.

  5. Call "ajaxRequest()" in onclick event of href and handle passed event

    <a href='#' onclick="ajaxRequest(MainForm.form, 'linkclick', ['param=value']);">Click me!</a>
    

    This code should be located inside TUniHTMLFrame to work.

    • Upvote 1
  6. I use this simple approach for custom events  :)  In JS code

    MainForm.form.showMask('Loading...');
    ajaxRequest(...);
    

    In ajax event

    try
      ...
    finally
      UniSession.AddJS('MainForm.form.hideMask();');
    end;
    
×
×
  • Create New...