apicito
-
Posts
23 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by apicito
-
-
Very useful when trying to validate a set of edits.
DelphiDeveloper gives a solution in this case for TPanel:
http://forums.unigui.com/index.php?/topic/3981-form-onblur-validation-for-multiple-fields/
But I think it would be interesting to simplify the management of this event in TPanel and add
in GroupBox
Regards.
-
Fine!. Thanks Delphi Developer.
But do not think it would be useful to support a simpler Blur event in Panels and GroupBox?
I will propose in new features forum.
regards.
-
Clarifying my first post:
I need to do the validation of multiple fields when leaving a grouping of Edits.
If I use a uniPanel for grouping two edits I do:
in extEvent -> Blur of uniPanel:function blur(sender, the, eOpts) { ajaxRequest(sender, 'eventoSair', ['param0=MyParam'] ); }
In UniPanel1AjaxEvent of uniPanel:
procedure TMainForm.UniPanel1AjaxEvent(Sender: TComponent; EventName: string;Params: TStrings); begin if EventName='eventoSair' then begin UniMemo1.Lines.Add('Server Response:'); UniMemo1.Lines.Add('==============='); UniMemo1.Lines.Add(Params.Values['param0']); UniMemo1.Lines.Add(''); end; end;
I can´t use uniGroupBox for grouping because it don't have the "onAjaxEvent".
Can anyone provide me some solution to this?. -
-
Fine. Tnks.
-
In creation of new windows I changed TUniFormClass for TUniBaseFormClass as Farshad Mohajeri I proposed:
http://forums.unigui.com/index.php?/topic/3933-undeclared-identifier-tuniformclass/I create form with a string name class (Formulario).
But this new class does not let me set the OnClose event:procedure TMainForm.CreateWindow(Formulario, FormCaption, FormHint: string); var formClass : TUniBaseFormClass; Form : TUniBaseForm; Window : TDesktopWindow; ButtonFooter: TUniSpeedButton; i : Integer; Bitmap : TBitmap; begin frmStart.Hide; UpAllButtons; formClass := TUniBaseFormClass(FindClass('T'+Formulario)); Form := formClass.Create(UniApplication); if IsWindowOpen(Form)=False then begin Window := TDesktopWindow.Create; Window.Window := Form; Window.Name := Form.Name; Window.Window.Caption:=FormCaption; --> Window.Window.OnClose := UniFormCloseAll; // PROBLEM !!! Datos.ListWindows.Add(Window); .......
How can I fix this?
-
Tkns.
-
I have a question:
When I use the "now" function get the server or client time? -
Anybody can help me with this problem?
-
This is the unit:
unit uAveriasExpteEdit; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, uniGUITypes, uniGUIAbstractClasses, uniGUIClasses, uniGUIForm, Data.FMTBcd, Data.DB, Datasnap.DBClient, Datasnap.Provider, Data.SqlExpr, uniEdit, uniDBEdit, uniGUIBaseClasses, uniMultiItem, uniComboBox, uniDBComboBox, uniDBLookupComboBox, uniButton, uniMemo, uniDBMemo, uniLabel, uniPanel; type TAveriasExpteEdit = class(TUniForm) QueryTipo: TSQLQuery; dspTipo: TDataSetProvider; cdsTipo: TClientDataSet; LargeintField4: TLargeintField; StringField4: TStringField; surceTipo: TDataSource; queryZona: TSQLQuery; dspZona: TDataSetProvider; cdsZona: TClientDataSet; LargeintField11: TLargeintField; StringField11: TStringField; surceZona: TDataSource; surceEstado: TDataSource; cdsEstado: TClientDataSet; LargeintField18: TLargeintField; StringField18: TStringField; dspEstado: TDataSetProvider; queryEstado: TSQLQuery; queryExpte: TSQLQuery; dspExpte: TDataSetProvider; cdsExpte: TClientDataSet; cdsExpteAVEDIA_CODIGO: TLargeintField; cdsExpteAVEDIA_TIPO: TLargeintField; cdsExpteAVEDIA_ZONA: TLargeintField; cdsExpteAVEDIA_ESTADO: TLargeintField; cdsExpteAVEDIA_ASIGNADO: TStringField; cdsExpteAVEDIA_LOCALIZACION: TStringField; cdsExpteAVEDIA_DESCRIP: TStringField; cdsExpteAVEDIA_TER_DNI: TStringField; cdsExpteAVEDIA_TER_DNI_DUP: TFMTBCDField; cdsExpteAVEDIA_TER_NOME: TStringField; cdsExpteAVEDIA_TER_ENDEREZO: TStringField; cdsExpteAVEDIA_TER_POBO: TStringField; cdsExpteAVEDIA_TER_TLNO: TStringField; cdsExpteAVEDIA_TER_EMAIL: TStringField; cdsExpteAVEDIA_TER_NOTIFICACION: TFMTBCDField; cdsExpteAVEDIA_A_USUARIO: TStringField; cdsExpteAVEDIA_A_FECHA: TSQLTimeStampField; cdsExpteAVEDIA_M_USUARIO: TStringField; cdsExpteAVEDIA_M_FECHA: TSQLTimeStampField; surceExpte: TDataSource; cEstado: TUniDBLookupComboBox; cZona: TUniDBLookupComboBox; cTipo: TUniDBLookupComboBox; UniDBEdit1: TUniDBEdit; eNome: TUniDBEdit; eTlno: TUniDBEdit; eMail: TUniDBEdit; eEnderezo: TUniDBEdit; ePobo: TUniDBEdit; UniLabel1: TUniLabel; UniLabel2: TUniLabel; UniLabel3: TUniLabel; UniLabel4: TUniLabel; UniLabel5: TUniLabel; UniLabel6: TUniLabel; UniLabel7: TUniLabel; UniLabel8: TUniLabel; UniLabel9: TUniLabel; UniLabel11: TUniLabel; UniDBMemo1: TUniDBMemo; UniDBEdit7: TUniDBEdit; UniLabel10: TUniLabel; BOk: TUniButton; BCancel: TUniButton; eAsignado: TUniDBEdit; PEdit: TUniPanel; procedure UniFormShow(Sender: TObject); procedure CargaTipos; procedure CargaZonas; procedure CargaEstados; procedure BCancelClick(Sender: TObject); procedure BOkClick(Sender: TObject); procedure UniFormClose(Sender: TObject; var Action: TCloseAction); private public Codigo : Integer; Modo : char; end; implementation uses uniGUIApplication, Datosunit; {$R *.dfm} procedure TAveriasExpteEdit.UniFormShow(Sender: TObject); begin CargaTipos; CargaZonas; CargaEstados; cdsExpte.Close; with queryExpte do begin SQL.Clear; SQL.Add('select * from AVEAVEDIA where AVEDIA_CODIGO=:codigo'); end; cdsExpte.Params.ParamByName('codigo').AsInteger := Codigo; cdsExpte.Open; case Modo of 'A' : begin Caption := 'Alta'; cdsExpte.Insert; cdsExpte.FieldByName('AVEDIA_CODIGO').AsInteger := Datos.getAutoincremental; end; 'M' : begin Caption := 'Editar'; cdsExpte.Edit; end; 'E' : begin Caption := 'Eliminar'; BOk.Caption := '<i class="fa fa-check fa-2x color-verde">'+ '</i><span class=" fa-15x color-roxo" style="margin-left:1em">ELIMINAR</span>'; end; end; end; procedure TAveriasExpteEdit.BOkClick(Sender: TObject); var Td : TTransactionDesc; begin td.TransactionID:=1; td.IsolationLevel:=xilREADCOMMITTED; Datos.Conexion.StartTransaction(td); if Modo = 'E' then cdsExpte.Delete else if cdsExpte.Modified then cdsExpte.Post; if cdsExpte.ChangeCount > 0 then if cdsExpte.ApplyUpdates(0)=0 then Datos.Conexion.Commit(td) else begin Datos.Conexion.Rollback(td); showmessage('Error al grabar'); Exit; end; cdsExpte.Close; ModalResult := mrOk; end; procedure TAveriasExpteEdit.BCancelClick(Sender: TObject); begin ModalResult := mrCancel; end; procedure TAveriasExpteEdit.UniFormClose(Sender: TObject; var Action: TCloseAction); begin cdsExpte.Close; cdsTipo.Close; cdsZona.Close; cdsEstado.Close; end; procedure TAveriasExpteEdit.CargaTipos; begin cdsTipo.Close; with QueryTipo do begin SQL.Clear; SQL.Add('select AVETIP_CODIGO,AVETIP_DESCRIP,AVETIP_ACTIVO'); SQL.Add('from AVEAVETIP'); SQL.Add('where AVETIP_ACTIVO=1'); SQL.Add('order by AVETIP_DESCRIP'); end; cdsTipo.Open; end; procedure TAveriasExpteEdit.CargaZonas; begin cdsZona.Close; with QueryZona do begin SQL.Clear; SQL.Add('select AVEZON_CODIGO,AVEZON_DESCRIP,AVEZON_ACTIVO'); SQL.Add('from AVEAVEZON'); SQL.Add('where AVEZON_ACTIVO=1'); SQL.Add('order by AVEZON_DESCRIP'); end; cdsZona.Open; end; procedure TAveriasExpteEdit.CargaEstados; begin cdsEstado.Close; with QueryEstado do begin SQL.Clear; SQL.Add('select AVEEST_CODIGO,AVEEST_DESCRIP,AVEEST_ACTIVO'); SQL.Add('from AVEAVEEST'); SQL.Add('where AVEEST_ACTIVO=1'); SQL.Add('order by AVEEST_DESCRIP'); end; cdsEstado.Open; end; end.
-
In a uniDBGrid I list a table records with calculate fields.
With this code I create new form for edit one Record:
procedure TAveriasFrame.GridExptesDblClick(Sender: TObject); var AveriasExpteEdit : TAveriasExpteEdit; begin AveriasExpteEdit := TAveriasExpteEdit.Create(UniApplication); AveriasExpteEdit.Codigo := Codigo; AveriasExpteEdit.Modo := Modo; AveriasExpteEdit.ShowModal( procedure(Result : integer) begin if Result = 1 then begin cdsExpte.Refresh; end; end ); end;
When I save changes and applyupdates in AveriasExpteEdit form and return to form with grid not refresh the Grid. But if I reload page or put 2 times "cdsExpte.Refresh;" it's work fine.
if Result = 1 then begin cdsExpte.Refresh; cdsExpte.Refresh; end;
Can anyboby hel me with this problem.
Thanks.
-
-
I find to use "icons Font Awesome" (http://fontawesome.io/icons/) for toolsbar or buttons.
Can any body help me?.
Regards.
-
Sorry to hijack your thread. If you do not mind please post your progress and what worked so we can
improve the UniGui roadmap. Thanks
Thanks for reply.
I can´t work arround this now. I study in the future becouse my application needs texts edition in central place.
-
It's posible integrate a html richtext editor in a Unigui web form?
form: onBlur validation for multiple fields
in General
Posted
I understand.
Tnks.