Jump to content

Search the Community

Showing results for tags 'callback'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • uniGUI Public
    • Announcements
    • General
    • Feature Requests
    • Installation
    • Deployment
    • Other Platforms
  • Licensing
    • Licensing
    • Ordering uniGUI
  • Bug Reports
    • Active Reports
    • Closed Reports
    • Old Bug Reports
  • uniGUI Development
    • General Development
    • uniGUI Releases & Roadmaps
    • Utilities
  • Mobile Platform
    • uniGUI Mobile
    • Mobile Browsers
  • Users Area
    • Sample Projects
    • Components and Code Samples
    • Third Party Components
  • Non-English
    • Non-English
  • Miscellaneous
    • Hosting
    • Server Security
    • Jobs

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 8 results

  1. Hi, I just made a HTTP call in UniGui Desktop and it works perfectly. I made the same in UniGui Mobile using mobile components and it's not working. HTTP - Request procedure TUFmLoginm.btLoginRequestClick(Sender: TObject); Var aUrlSubmit, aUrlCancel, aUrl, sProtocol :string; Begin frmPinm.UnimURLFrame1.URL := ''; if UniServerModule.PINEndPoint.Contains('https') then sProtocol := 'https' else sProtocol := 'http'; aUrlSubmit := UniSession.CallbackUrlEx('loggedwithcredentials', self, ['RES', 'OK']); if sProtocol.Contains('https') and not aUrlSubmit.Contains('https') then aUrlSubmit := aUrlSubmit.Replace('http', sProtocol, []); aUrlSubmit := aUrlSubmit.Replace(#$D#$A, '', [rfReplaceAll]); aUrlSubmit := TNetEncoding.URL.Encode(TStringRoutines.GetBase64CryptedString(aUrlSubmit)); aUrlCancel := UniSession.CallbackUrlEx('logincancelled', self, ['RES', 'Cancel']); if sProtocol.Contains('https') and not aUrlCancel.Contains('https') then aUrlCancel := aUrlCancel.Replace('http', sProtocol, []); aUrlCancel := aUrlCancel.Replace(#$D#$A, '', [rfReplaceAll]); aUrlCancel := TNetEncoding.URL.Encode(TStringRoutines.GetBase64CryptedString(aUrlCancel)); if TUniGUIApplication(UniApplication).Parameters.values['gestore'].IsEmpty then aUrl := UniServerModule.PINEndPoint+'/?action=authn&gestore='+UniMainModule.gestore+'&url_submit='+aUrlSubmit+'&url_cancel='+aUrlCancel+'&_S_ID='+UniSession.SessionId+'&appid='+UniMainModule.appID else aUrl := UniServerModule.PINEndPoint+'/?action=authn&gestore='+TUniGUIApplication(UniApplication).Parameters.values['gestore']+'&url_submit='+aUrlSubmit+'&url_cancel='+aUrlCancel+'&_S_ID='+UniSession.SessionId+'&appid='+UniMainModule.appID; frmPinm.UnimURLFrame1.URL := aURL; frmPinm.Show End; End Point procedure TFrmAuthnm.FormPost; var data_event : string; begin { ... elaboration ... } with UniMainModule.GetDM do begin if not UniMainModule.Url_submit.IsEmpty then begin if FResponsePost then begin s := 'var f = document.createElement("form"); '+ 'f.action="'+UniMainModule.Url_submit+'"; '+ // the second app url 'f.method="POST"; '; s := s+ 'var i=document.createElement("input"); '+ // url_submit 'i.type="hidden"; '+ 'i.name="data_event"; '+ 'i.value="'+TNetEncoding.Url.Encode(data_event)+'"; '+ 'f.appendChild(i); '; s := s+ 'document.body.appendChild(f); '+ 'f.submit(); '; UniSession.AddJS(s) end else UniSession.UrlRedirect(UniMainModule.Url_submit+'&data_event='+TNetEncoding.Url.Encode(data_event)); end; end; Ajax Event that intercept CallBack procedure TUFmLoginm.UnimLoginFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); var jsonResponse, aURL : string; credentials : TLoginCredentials; begin if (EventName = 'loggedwithcredentials') and (Params.Values['RES']='OK') then begin if not Params.Values['data_event'].IsEmpty then begin // elab .... frmPinm.Hide; ModalResult := mrOK finally credentials.Free end end end end; All works fine except AjaxEvent that doesn't intercept the EventName "loggedwithcredentials".
  2. Hello, I have a DbNavigator with Delete button enabled and Confirm Delete disabled, because I need a custom message on Delete. So I have put this code in the onBeforeDelete event of the DataSet: procedure TformCustomers.tabCompositionBeforeDelete(DataSet: TDataSet); begin // Ask confirm MessageDlg('Confirm Delete of item: '+ tabComposition.FieldByName('TABLECODE').AsString +' ?', mtConfirmation, mbYesNo, procedure(Sender: TComponent; Res: Integer) begin if Res <> mrYes then // Annulla delete Abort; end//procedure );//MessageDlg end; But the records get deleted before my answer... Can you help ?
  3. [PT-BR] Boa Tarde, Estou com o seguinte problema: preciso passar uma procedure/function para ser executada como callBack de um form devido caso em que o EnableSynchronousOperations não atende ao esperado. Essa implementação ficaria como? Abaixo segue a ideia de como estou tentando fazer, porém sem sucesso. Obs.: o código abaixo é apenas um esboço para facilitar o entendimento do problema. [ENG] Good afternoon, I am having the following problem: I need to pass a procedure / function to run as a form return in case the EnableSynchronousOperations does not meet expected. This implementation would look like? Below is an idea of how I am trying to do, but to no avail. Note: The code below is just a sketch to make it easier to understand the problem. /// Eu Criei uma classe com algo parecido com o seguinte TCallBack = procedure(Sender: TComponent; Res: Integer) of object; TFrmDialogs = class(TUniForm) function MessageBox(const Text: string; pCallBack: TCallBack=Nil): Integer; end; function MessageBox(const Text: string; pCallBack: TCallBack=Nil): Integer; var vMsg: TFrmDialogs; begin vMsg.Text := vMsg; if Assigned(pCallBack) then begin Result := vMsg.ShowModal(pCallBack); end else Result := vMsg.ShowModal(); end; /// Aqui eu executo onde eu preciso (no caso em outra classe) procedure TDataModulo.DoReconectarCallBack(Sender: TComponent; Res: Integer); begin if Res <> 6 then // Não clicou Yes else begin // Clicou Yes end; end; procedure TDataModulo.Acao; begin MessageBox('Minha Mensagem!', DoReconectarCallBack); end; Desde já obrigado à quem puder ajudar [EDITED] Esqueci de colocar o problema I forgot to put the problem [dcc32 Error] uAnDialogs.pas(112): E2010 Incompatible types: 'Integer' and 'procedure, untyped pointer or untyped parameter'
  4. Ejemplo al presionar el botón ok procedure btnOKClick(Sender: TObject); procedure Imprimir; begin UniMainModule.CrearWebFilePath; UniSession.AddJS('window.open('+QuotedStr(UniMainModule.WebFilePath)+',"_blank", "status=no,location=no,resizable=no,dependent=yes,toolbar=no,menubar=no", "false");' ); end; begin UniScreenMask1.AttachedControl := btnOk; UniScreenMask1.TargetControl := Self; Self.MessageDlg('Desea imprimir el contenido?', mtConfirmation, mbYesNo, procedure (Sender: TComponent; Res: Integer) var cerrarModal: boolean; begin cerrarModal := Res = mrNo; if not cerrarModal then Imprimir else CloseModal; end); end; En ese ejemplo no sale nunca el mensaje, y mucho menos se abre la nueva ventana que contendría el archivo pdf a imprimir. La prueba fue hecha sobre Chrome. Porqué puede ser que no dispare el messagedlg?. Tampoco cierra el form porque nunca se ejecuta el callback
  5. "MessageScreen" - Blocking(!) Message- and InputDialogs and "Live" StatusMessages (with Abort option) No need for callbacks or extra threads or ... - Live Status messages (show the user at every time, what you are just doing) - Blocking(!) Input Dialog - Blocking(!) Message Dialog - "Abort option" at every time Sample Code: procedure TfrmMain.btnTestClick(Sender: TObject); var Nam: String; i: Integer; Br: Boolean; begin MS.Show; try // "Live" Status Messages: MS.StatusMsg('Step 1 / 3 ...'); Sleep(4000); // Do Something here ... MS.StatusMsg('Step 2 / 3 ...'); Sleep(4000); // Do Something here ... MS.StatusMsg('Step 3 / 3 ...'); Sleep(4000); // Do Something here ... // Input Dialog: if MS.InputDlg('Please enter your name:', 'Bill', 50) = 1 then begin Nam := MS.LastAnswerVal; MS.MessageDlg('Your name is ' + Nam + '!', 'OK'); end; // Message Dialog: case MS.MessageDlg('What do you want to do today, ' + Nam + '?', 'Do This', 'Do That', 'Do Everything', 'Do Anything' , 'Do Nothing') of 1: MS.MessageDlg('You Pressed Button 1!', 'OK'); 2: MS.MessageDlg('You Pressed Button 2!', 'OK'); 3: MS.MessageDlg('You Pressed Button 3!', 'OK'); 4: MS.MessageDlg('You Pressed Button 4!', 'OK'); 5: MS.MessageDlg('You Pressed Button 5!', 'OK'); else raise Exception.Create('There is no other Button, only 1 - 5 ?!'); end; // "Live" Status Messages with "ABORT" option: Br := False; for i := 1 to 10000000 do begin MS.StatusMsg('Record ' + IntToStr(i) + ' / 10000000', 1000, True); // !!! Important: Use "Delay" (here 1000 ms) if there are many Updates per second !!! if MS.HasAbort then begin if MS.MessageDlg('Really ABORT ?', 'Yes', 'No') = 1 then begin Br := True; BREAK; end; end; end; if Br then begin MS.MessageDlg('User has pressed ABORT !', 'OK'); end; MS.StatusMsg('Ready!'); Sleep(2000); finally MS.Hide; end; end; MsgScr.zip
  6. Hi everybody. I have an issue I cant resolve... How to do a continuos showmodal. I explain it. In normal scene I have this behavior. procedure TValidaVentasForm.EtiquetasButtonClick(Sender: TObject); begin while true do begin // send the form.... CodigosBarrasForm.ShowModal; // And obtain some data of that... id:=CodigosBarrasForm.CodigoEdit.Text; // if id<>'' then // we obtained valid data DoSomeVeryInterestingWithTheData(id) else break; // <---- The end of the show // or I repeat again... end; // end; I run a showmodal form to obtain a data from it until this data is an empty string.... Yes, yes, I know your answer.... Callback functions.... Here is my unigui stage: procedure TValidaVentasForm.EtiquetasButtonClick(Sender: TObject); begin CodigoBarrasform.showModal(self.FormCodigoBarrasLectura); // <---- The below procedure as callback parameter end; procedure TValidaVentasForm.FormCodigoBarrasLectura(Sender: TComponent; AResult: Integer); // <---- The callback begin // In the below variable I put the result obtained CodigoBarrasForm in mainmodule to use here... if UniMainModule.TheIDObtainedFromCodigodeBarrasForm<>'' then begin DoSomeVeryInterestingWithTheData(UniMainModule.TheIDObtainedFromCodigodeBarrasForm); // How to relaunch the form again ? end; //else // Does not happend anything // // Here is the puzzle... Please help me... how to drive this... // // // if UniMainModule.TheIdObtainedFromCodigodeBarrasForm<>'' then // begin // DoSomeVeryInterestingWithTheData(UniMainModule.TheIdObtainedFromCodigodeBarrasForm); // // But How to repeat the showmodal() ? // How to do a working: // self.EtiquetasButtonClick(Self); // end; end How to launch again the codigoBarrasForm until the CodigosBarrasform.CodigoEdit text = '' ???? Any help is welcomed.
  7. Hello Guys! Please give me an example of how Farshad, creates the function will return with callback. I tried several ways and can not do as he does, passing the procedure within the call. I need to ride some, but only managed to procedures outside the call, I would call could equal the example below: UniForm1.Show ( procedure (Result: Integer) begin UniMemo1.Lines.Add ('Form Close:' + IntToStr (Result)); end );
  8. Proposed new component A TEDIT / DBEDIT component that has a button associated or event as an F4 Double click with the characteristic that can query a table, select a component in the specified field and return it to the TDBEdit / DBEDIT. My solictud is that I do so in delphi 5 and saves me lots of time developing, I think it might be a standard component of software component or otherwise a component of PAYMENT basic example New properties Table query when the edit / DBEdit (select table) is pressed Country and return value to edit (select from table columm) filter associated with the component (where) functionality He pressed F4 / doubleclick Displays generic way with the selected table XXXX When you select a field returns the value component I invoke the query
×
×
  • Create New...