Jump to content

SEGNA

uniGUI Subscriber
  • Posts

    10
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

SEGNA's Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. Hello, Thank you for your answer. Waiting for your sample.
  2. Hi, In my test project, I have a function in AfterScript in UniHtmlFrame. I can call a Function and define a variable with UniFormAjaxEvent. There is no problem until this point. But when I click on a button I want to get the Result value returned from the function to Result.Text box. "Result.Text := js(Param.Text);". When Unisession.AddJS runs, I assign ReturnValue in AjaxEvent. But when the function is finished, AjaxEvent assigns it. Thus, it returns the value as the previous value. Sample test project is attached. Thank you. unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, uniGUITypes, uniGUIAbstractClasses, uniGUIClasses, uniGUIRegClasses, uniGUIForm, uniButton, uniGUIBaseClasses, uniEdit, uniPanel, uniHTMLFrame, uniLabel; type TMainForm = class(TUniForm) result: TUniEdit; UniButton1: TUniButton; UniHTMLFrame1: TUniHTMLFrame; param: TUniEdit; UniLabel1: TUniLabel; UniLabel2: TUniLabel; procedure UniButton1Click(Sender: TObject); procedure UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); private ReturnValue : string; function js(test: string): string; public { Public declarations } end; function MainForm: TMainForm; implementation {$R *.dfm} uses uniGUIVars, MainModule, uniGUIApplication; function MainForm: TMainForm; begin Result := TMainForm(UniMainModule.GetFormInstance(TMainForm)); end; function TMainForm.js(test: string): string; begin UniSession.AddJS('myFunction('+ test +')'); Result := ReturnValue; end; procedure TMainForm.UniButton1Click(Sender: TObject); begin result.Text := js(param.Text); end; procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_test' then begin ReturnValue := Params.Values['Value']; end; end; initialization RegisterAppFormClass(TMainForm); end. Test.rar
  3. Hi, Problem is solved. Thank you for your support.
  4. Hi, I am writing a simple alert function in afterscript inside unihtmlframe. And when I try to call it at runtime with a button on the form, I get the undefined warning. It works when I write it inside the html string. But the field I need to use is aftersciprt, I have a different code running there. UniHTMLFrame AfterScript; function myFunction() { alert("Alert..."); } Button Click Code; procedure TMainForm.UniButton1Click(Sender: TObject); begin UniSession.AddJS('myFunction()'); end; How can i solve the problem? Thank you.
  5. Hi, As an example I am sending parameters by running GET method inside MainForm with htmlframe "http://localhost:8077/test?FormName=MainForm&Data=FDQuery1" On the serverModule side, when I receive the incoming call in UniGUIServerModuleHTTPCommand, I need to connect to the form in the parameter and get the sql text of the dataset. I cannot access MainForm or any other active form from within ServerModule. I need to make calculations on the sql side and send the result as text. procedure TUniServerModule.UniGUIServerModuleHTTPCommand( ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo; var Handled: Boolean); var prmFormName, prmData, s : string; Form : TUniForm; FDQuery: TFDQuery; begin if ARequestInfo.Command = 'GET' then if ARequestInfo.URI = '/test' then begin prm := ARequestInfo.Params.Values['FormName']; prmDataSet := ARequestInfo.Params.Values['Data']; /// ConnectionCreate ..... FDQuery := FDQuery.Create; FDQuery.Connection := ....; FDQuery.Sql.Text := TUniForm(UniApplication.FindComponent('MainForm') as TUniForm ).FindComponent( 'FDQuery1' ) as TFDQuery).SQL.Text; FDQuery.Open; //I need to make calculations on the sql side and send the result. as text. AResponseInfo.ContentText := Result; AResponseInfo.WriteContent; end; end;
  6. One of the code i used : FDQery.Sql.Text := (TUniForm(UniApplication.FindComponent('MainForm') as TUniForm ).FindComponent( 'FDQuery1' ) as TFDQuery).SQL.Text;
  7. Hi, I want to connect the string FormName parameter that comes with the UniGUIServerModuleHTTPCommand procedure to a previously created form with that name and access the sql text of the FDqery in it. procedure TUniServerModule.UniGUIServerModuleHTTPCommand( ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo; var Handled: Boolean); var prmFormName, s : string; Form : TUniForm; begin if ARequestInfo.Command = 'GET' then if ARequestInfo.URI = '/test' then begin prm := ARequestInfo.Params.Values['FormName']; s := Form.FDQuery1.SQL.Text; // The example here is simplified. I tried to reach with Formclass but I get "Address Access Violation" warning. // // The form I want to connect to was previously created in uniapliacation. This form can be a MainForm or an open form with a list of Customers. // // I need the sql text of the FDquery in that form. end; end;
  8. Merhaba, MainForm da menü için htmlframe kullanıyorum. Login Form kullanmadığımda mainformdaki htmlframe çalışıyor. Menü sekmelerini açabiliyorum. Fakat login form eklendiğinde main formda htmlframe üzerinde treeview sekmelerine tıkladığımda herhangi bir işlem olmuyor. Bu sorunu nasıl çözebilirim ? LoginForm olmadan kusursuz çalışıyor. Başka birşey daha denedim mainform üzerindeki htmlframe menüyü loginform üzerine kopyalarsam, loginform ve mainformda yine kusursuz çalışıyor. LoginForm üzerinden kaldırırsam mainformda hiçbir işlev göstermiyor. HtmlFrame; <aside class="main-sidebar sidebar-dark-primary elevation-4"> <a href="../index3.html" class="brand-link"><img src="../files/" alt="TEST Logo" class="brand-image img-circle elevation-3" style="opacity: .8"> <span class="brand-text font-weight-light">TEST</span> </a> <div class="sidebar"> <div class="user-panel mt-3 pb-3 mb-3 d-flex"> <div class="image"> <img src="../files/" alt="User Image" class="brand-image img-circle elevation-3" style="opacity: .8"> </div> <div class="info"> <a href="#" class="d-block">Test</a> </div> </div> <nav class="mt-2"> <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false"> <li class="nav-item menu-is-opening menu-open"><a href="#" class="nav-link"> <i class="nav-icon fas fa-tachometer-alt"></i> <p> Test <i class="right fas fa-angle-left"></i> </p> </a> <ul class="nav nav-treeview" style="display: block;"> id <li class="nav-item"> <a href="#" class="nav-link" onclick="ajaxRequest(MainForm.htmlframe, 'DashboardF', ['title=test'])"><i class="far fa-circle nav-icon"></i> <p>test</p> </a> </li> </ul> </li> <li class="nav-item menu-is-opening menu-open"><a href="#" class="nav-link"> <i class="nav-icon fas fa-tree"></i> <p> Test1 <i class="right fas fa-angle-left"></i> </p> </a> <ul class="nav nav-treeview" style="display: block;"> id <li class="nav-item"> <a href="#" class="nav-link" onclick="ajaxRequest(MainForm.htmlframemenu, 'GeneralFormF', ['title=test'])"><i class="far fa-circle nav-icon"></i> <p>test</p> </a> </li> </ul> </li> </ul> </nav> </div> </aside> TestMenu.rar
  9.  

    Hi Sherzod,

    I loaded the CustomDBGrid as a component, I can set a value for the filter as in the example. When I look at the properties in Columns, the Filter string field does not appear. Is it possible to add the filter property here? I would be glad if you help.

    The version I used is uni-1.90.0.1560.

    Thank you 

    1. Sherzod

      Sherzod

      Hello,

      This post may help you:

       

  10. Hello, Did you manage to show the property?
  11. Merhaba Hayri Bey, CustomDBGrid i component olarak yükledim örnekteki gibi filter için değer atıyabiliyorum. Columns içindeki propertylere baktığım da ise Filter string alanı görünmüyor. Filter property i buraya eklemek mümkün mü? Yardımcı olursanız sevinirim. Kullanmış olduğum versiyon uni-1.90.0.1560.
×
×
  • Create New...