FabioMorcillo Posted December 21, 2018 Share Posted December 21, 2018 Hi, I have trying UniGUI and create custom UniEdit with button. In UniEdit UniEvents set beforeInit -> lUniEdit.ClientEvents.UniEvents.Values['beforeInit'] := 'function beforeInit(sender, config) { config.triggers = { search: { cls: ''fa fa-ellipsis-h'', handler: function() { *** need call public procedure on custom UniEdit here *** } } } }'; Type TCustomUniEdit = class(TUniEdit) public procedure ButtonClick; Is possible call ButtonClick in custom component using UniEvents ? Thank you, Quote Link to comment Share on other sites More sharing options...
FabioMorcillo Posted December 26, 2018 Author Share Posted December 26, 2018 Anyhere can help me ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 26, 2018 Share Posted December 26, 2018 Can you please specify which edition and build of UniGUI are you using? Quote Link to comment Share on other sites More sharing options...
FabioMorcillo Posted December 26, 2018 Author Share Posted December 26, 2018 Hi Sherzod, I am using uniGUI Complete Trial Edition 1.50.0.1482. We are developing a basic system with the resources we need for approval to buy UniGUI. Thank you, Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 26, 2018 Share Posted December 26, 2018 Hi, Thank you for your interest in UniGUI! You can use ajaxRequest in handler fn: function beforeInit(sender, config) { config.triggers = { search: { cls: 'fa fa-ellipsis-h', handler: function() { ajaxRequest(sender, '_search', ['val='+sender.getValue()]) } } } } And OnAjaxEvent on the server side: procedure TMainForm.UniEdit1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_search' then begin ShowMessage(Params.Values['val']); end; end; Quote Link to comment Share on other sites More sharing options...
FabioMorcillo Posted January 11, 2019 Author Share Posted January 11, 2019 Thank you so much Sherzod The ShowMessage in AjaxEvent open window message in server side. Can i open this showmessage in client side or open new Form in client side ? Quote Link to comment Share on other sites More sharing options...
FabioMorcillo Posted January 15, 2019 Author Share Posted January 15, 2019 Good morning Sherzod Can you give this last help ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 15, 2019 Share Posted January 15, 2019 On 1/11/2019 at 6:38 PM, FabioMorcillo said: The ShowMessage in AjaxEvent open window message in server side. Can i open this showmessage in client side or open new Form in client side ? Hello, Please clarify the question, What kind of form, what form of the message, and for what purpose do you want to use them? Quote Link to comment Share on other sites More sharing options...
FabioMorcillo Posted January 15, 2019 Author Share Posted January 15, 2019 Hello procedure TMainForm.UniEdit1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_search' then begin ShowMessage(Params.Values['val']); end; end; When we click in search button and made this AjaxEvent, this ShowMessage don´t open dialog message in browser ( client-side ) We need when click in this search button, open new TUniForm in browser ( client-side ) Quote Link to comment Share on other sites More sharing options...
FabioMorcillo Posted January 15, 2019 Author Share Posted January 15, 2019 When we click this search button in this Custom UniEdit, it opens this dialog box outside the browser. https://drive.google.com/file/d/1xkYsj79Gmwl9F3nruYRhGrDQDPjfYj1O/view?usp=sharing Quote Link to comment Share on other sites More sharing options...
FabioMorcillo Posted January 15, 2019 Author Share Posted January 15, 2019 Worked We need to uses uniGUIDialogs in custom component to showmessage in browser Quote Link to comment Share on other sites More sharing options...
DEV_THS Posted April 2, 2019 Share Posted April 2, 2019 On 12/26/2018 at 3:36 PM, Sherzod said: Hi, Thank you for your interest in UniGUI! You can use ajaxRequest in handler fn: function beforeInit(sender, config) { config.triggers = { search: { cls: 'fa fa-ellipsis-h', handler: function() { ajaxRequest(sender, '_search', ['val='+sender.getValue()]) } } } } And OnAjaxEvent on the server side: procedure TMainForm.UniEdit1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_search' then begin ShowMessage(Params.Values['val']); end; end; Hello, Sherzod ... okay? Would it be possible to intercept the onChange event of a UniEdit through ajaxRequest? Thank you! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 2, 2019 Share Posted April 2, 2019 2 minutes ago, DEV_THS said: Would it be possible to intercept the onChange event of a UniEdit through ajaxRequest? Hello, Sorry, can you please clarify your question?! Quote Link to comment Share on other sites More sharing options...
DEV_THS Posted April 2, 2019 Share Posted April 2, 2019 8 minutes ago, Sherzod said: Hello, Sorry, can you please clarify your question?! Yes of course! I created a component that inherits from a UniDateTimePicker and I have in this component a Subcomponent of the UniEdit Type At some point I set values for this UniEdit and I'd like to intercept the OnChange event of it when that value is changed by the user ... it would be possible? Quote Link to comment Share on other sites More sharing options...
DEV_THS Posted April 2, 2019 Share Posted April 2, 2019 16 minutes ago, DEV_THS said: Yes of course! I created a component that inherits from a UniDateTimePicker and I have in this component a Subcomponent of the UniEdit Type At some point I set values for this UniEdit and I'd like to intercept the OnChange event of it when that value is changed by the user ... it would be possible? This FMaskEdit.OnChange does not fire when it has changes on the part of the user at run time. Quote Link to comment Share on other sites More sharing options...
DEV_THS Posted April 2, 2019 Share Posted April 2, 2019 5 minutes ago, DEV_THS said: This FMaskEdit.OnChange does not fire when it has changes on the part of the user at run time. I got to have a similar case, where I managed to solve this way, it was a button that was also a subcomponent and when it was clicked the click event was not triggered. procedure TPLUniEdit.LoadCompleted; begin inherited; TUniForm(Self.OwnerForm).UniSession.AddJS('document.getElementById("'+ self.Button.JSControl.Id +'").addEventListener("click", function() {ajaxRequest(' + Format('%s.%s', [self.OwnerForm.Name, self.Name]) + ', ''Search'', { name: ''teste'', width: ''01''} );});'); end; procedure TPLUniEdit.JSEventHandler(AEventName: string; AParams: TUniStrings); begin inherited; if AEventName.Equals('Search') then OnClickBtn(nil); end; But in my other case, I could not solve in the same way with the OnChange of this UniEdit. Quote Link to comment Share on other sites More sharing options...
DEV_THS Posted April 2, 2019 Share Posted April 2, 2019 4 hours ago, Sherzod said: Hello, Sorry, can you please clarify your question?! Sherzod, I'm sorry, but did you come to understand my problem? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 2, 2019 Share Posted April 2, 2019 51 minutes ago, DEV_THS said: but did you come to understand my problem? Sorry not yet... Quote Link to comment Share on other sites More sharing options...
DEV_THS Posted April 2, 2019 Share Posted April 2, 2019 35 minutes ago, Sherzod said: Sorry not yet... okay ... let me try to explain it directly ... sometimes it gets a little easier, my problem is a little confusing indeed! lol but the following is happening. I have a component that inherits from a TuniDateTimePicker and within this component I have a Subcomponent of type TUniEdit. when I create my TuniDateTimePicker, I also create my TUniEdit I hedge an event on his OnChange. everything works fine, but when I upload the application and make a change in my TUniEdit the OnChange event that I created in the create is not triggered. and I need him to go through this event. Could you more or less understand my problem now? Quote Link to comment Share on other sites More sharing options...
naozuka Posted March 16, 2020 Share Posted March 16, 2020 On 4/2/2019 at 3:36 PM, DEV_THS said: okay ... let me try to explain it directly ... sometimes it gets a little easier, my problem is a little confusing indeed! lol but the following is happening. I have a component that inherits from a TuniDateTimePicker and within this component I have a Subcomponent of type TUniEdit. when I create my TuniDateTimePicker, I also create my TUniEdit I hedge an event on his OnChange. everything works fine, but when I upload the application and make a change in my TUniEdit the OnChange event that I created in the create is not triggered. and I need him to go through this event. Could you more or less understand my problem now? You can't put an maskedit inside a datetimepicker. Why do you need that? To put a mask? 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.