Jump to content
uniGUI Discussion Forums
Sign in to follow this  
FabioMorcillo

UniEdit ClientEvents UniEvents call procedure in custom component

Recommended Posts

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,

Share this post


Link to post
Share on other sites

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,

Share this post


Link to post
Share on other sites

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;

 

Share this post


Link to post
Share on other sites

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 ?

 

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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 )

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×