mazluta Posted September 29, 2022 Share Posted September 29, 2022 1. on my form i have 2 TUniEdit1 i want to add ExtEvent to TUniEdit1 onkeyup if the user click "^" in the TUniEdit1 i want to set TUniEdit1.Text to 'Hello' inside the OnKeyUp Clieck Event of the ExtEvent 2. in the ExtEvent, Whet is Sender? How Can I See What Is Members and Property Are? what is e - the same for Members and Property Are? what is eOpts - the same for Members and Property Are? 3. what is "document" or "windows" or "body" as relational to My FORM/FRAME 4. can i run ExtEvent OnKeyUp and the TUniEdit1.OnKeyUp on the same FORM/FRAME? what come first? is the ExtEvent is allwes ClientSide And Object.DelphiEvent is Server Side? 5. where can i find deeper documents on the ExtEvent for Older Delphi Developers Quote Link to comment Share on other sites More sharing options...
Denton Posted September 29, 2022 Share Posted September 29, 2022 Hi, If you take a look at the UniEdit1 > ClientEvents > ExtEvents you will see what ExtJS object it is using. Which is Ext.form.Field.Text. And then you can look at the documentation for Ext.form.Field.Text in ExtJS. 1 hour ago, mazluta said: if the user click "^" in the TUniEdit1 i want to set TUniEdit1.Text to 'Hello' inside the OnKeyUp Clieck Event of the ExtEvent 1. UniEdit1 > ClientEvents > ExtEvents > keyup: function keyup(sender, e, eOpts) { if (e.shiftKey && e.keyCode === 54) { sender.setValue('hello'); } } 1 hour ago, mazluta said: in the ExtEvent, Whet is Sender? How Can I See What Is Members and Property Are? 2. from: https://docs.sencha.com/extjs/7.0.0/classic/Ext.form.field.Text.html#event-keyup Sender = Ext.form.field.Text (or UniEdit1 in serverside) e = Javascript event object eOpts = (not sure) 1 hour ago, mazluta said: what is e - the same for Members and Property Are? you can try to console.log(e) on keyup event to see what are the properties. 1 hour ago, mazluta said: where can i find deeper documents on the ExtEvent for Older Delphi Developers you can take a look at ExtJS documentation to see more ExtEvents and its documentation. Hope it helps. Regards Quote Link to comment Share on other sites More sharing options...
mazluta Posted September 29, 2022 Author Share Posted September 29, 2022 WOW. thanks very much. a lot of reading. one more Q. i write keyup extevent like this : the purpose is to get the position of the cursor inside the text..... function keyup(sender, e, eOpts) { document.getElementById("M1234_aa-inputEl").value = e.target.selectionStart.toString(); /*document.getElementById("MyResultString").value = e.target.selectionStart.toString();*/ fLbl = document.getElementById("MyResultString"); fLbl.setText(e.target.selectionStart.toString()); } M1234_aa-inputEl -> is TUniedit and that work. MyResultString -> is some TUniLable - i want is caption to change to the same value - The SetText doesn't do nothing. Quote Link to comment Share on other sites More sharing options...
mazluta Posted September 29, 2022 Author Share Posted September 29, 2022 one more Q. is there a way to change Var in PUBLIC (under the form/frame) area from the ExtEvent function ? Quote Link to comment Share on other sites More sharing options...
mazluta Posted September 29, 2022 Author Share Posted September 29, 2022 i tried function keyup(sender, e, eOpts) { document.getElementById("M1234_aa-inputEl").value = e.target.selectionStart.toString(); /*document.getElementById("MyResultString").value = e.target.selectionStart.toString();*/ console.log("sender=" + sender); console.log("e=" + e); console.log("eOpts=" + eOpts); fLbl = document.getElementById("MyResultString"); fLbl.setText(e.target.selectionStart.toString()); } the result : sender=[object Object] - this give me nothing VM247:1 e=[object Object] VM247:1 eOpts=undefined how do i print to the console the TYPE of the obj like : sender= Ext.form.Field.Text Quote Link to comment Share on other sites More sharing options...
Denton Posted September 29, 2022 Share Posted September 29, 2022 i think u can try: console.log('sender=', Ext.getClassName(sender)); Quote Link to comment Share on other sites More sharing options...
Denton Posted September 29, 2022 Share Posted September 29, 2022 instead of using "+" , use " , " (comma). i think using + converts ur object to string Quote Link to comment Share on other sites More sharing options...
Denton Posted September 29, 2022 Share Posted September 29, 2022 22 minutes ago, mazluta said: fLbl is fLbl a TUniLabel in serverside? Quote Link to comment Share on other sites More sharing options...
mazluta Posted September 29, 2022 Author Share Posted September 29, 2022 5 minutes ago, Denton said: i think u can try: console.log('sender=', Ext.getClassName(sender)); that work Quote Link to comment Share on other sites More sharing options...
mazluta Posted September 29, 2022 Author Share Posted September 29, 2022 Just now, Denton said: is fLbl a TUniLabel in serverside? just TUniLabel on the Form Quote Link to comment Share on other sites More sharing options...
Denton Posted September 29, 2022 Share Posted September 29, 2022 2 minutes ago, mazluta said: just TUniLabel on the Form I think u can try: FormName.UniLabel1.setText("yourtext"); u should replace FormName with ur Form Quote Link to comment Share on other sites More sharing options...
mazluta Posted September 29, 2022 Author Share Posted September 29, 2022 i tryed. procedure TIturDocumentFrame.btnSendMailClick(Sender: TObject); Var FileAttche : String; begin If Not fIturResultFrame.DocumentsQry.Active Then Exit; If fIturResultFrame.DocumentsQry.RecordCount = 0 Then Exit; FileAttche := fIturResultFrame.DocumentsQry.FieldByName('Mz_FileName').AsString; NewSendMailFrm := TSendMailFrm.Create(UniApplication); NewSendMailFrm.FilesAttchLists.Add(FileAttche); NewSendMailFrm.ShowModal(CallBack_SendMail); end; the ExtEvent dont reconize this name and not - SendMailFrm Quote Link to comment Share on other sites More sharing options...
mazluta Posted September 29, 2022 Author Share Posted September 29, 2022 in DELPHI desktop (the old one) i can get the name from is PARENT. can i do it here? Quote Link to comment Share on other sites More sharing options...
Denton Posted September 29, 2022 Share Posted September 29, 2022 5 minutes ago, mazluta said: NewSendMailFrm := TSendMailFrm.Create(UniApplication); NewSendMailFrm.FilesAttchLists.Add(FileAttche); NewSendMailFrm.ShowModal(CallBack_SendMail); oh okay so it is dynamically created? u should put a name to your form like: NewSendMailFrm.Name := 'SendMailFrm'; for it to be recognize in javascript console Quote Link to comment Share on other sites More sharing options...
Denton Posted September 29, 2022 Share Posted September 29, 2022 procedure TMainForm.BtnSearchClick(Sender: TObject); var f : Ttestform22; begin f := Ttestform22.Create(UniApplication); f.name := 'mynewform'; f.ShowModal(); end; Quote Link to comment Share on other sites More sharing options...
mazluta Posted September 29, 2022 Author Share Posted September 29, 2022 23 minutes ago, Denton said: oh okay so it is dynamically created? u should put a name to your form like: NewSendMailFrm.Name := 'SendMailFrm'; for it to be recognize in javascript console that work too 1 Quote Link to comment Share on other sites More sharing options...
mazluta Posted September 29, 2022 Author Share Posted September 29, 2022 Denton - thank u very much. all your answer were OK 1 Quote Link to comment Share on other sites More sharing options...
mazluta Posted September 29, 2022 Author Share Posted September 29, 2022 see the cursor is between the char 7 and the char d -> position 7 in the TUniEdit function keyup(sender, e, eOpts) { document.getElementById("M1234_aa-inputEl").value = e.target.selectionStart.toString(); the UniEdit just by Id name (given in the form create - edCCList.JSControl.Id := 'M1234_aa'; watch that the INPUT name is - M1234_aa-inputEl MySendMailFrm.ExtEventResultString.setText(e.target.selectionStart.toString()); the UniLabel by form name and component name } 1 Quote Link to comment Share on other sites More sharing options...
Denton Posted September 30, 2022 Share Posted September 30, 2022 Glad it helps! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.