CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Cannot capture prompt value from user

by bob9999 » 24 Feb 2019 19:40

Hi there. I am attempting to display a prompt style message and all is working fine for that.

In the OnConfirm.OnEvent I use the code from the demo project sample to capture the "str" but this is empty. By the way your demo has a function call that does not work at all and I spent allot of time on diagnosis only to find I have to always use the IWCGJQShowMessage component. You may want to update your demo code that is installed to remove this reference so others in future are not affected. The code in the demo is IWCGShowPromptMessage('Please enter new filter tag:','bot',ConfirmAddFilterTagEvent); and any of these functions you have here are totally ignored at run-time.

How do I capture what the user entered for the prompt? Perhaps the "str" is an old reference for IW15.

Code for message:

IWCGJQShowMessage.JQShowMessageOptions.Labels.Cancel := 'CANCEL';
IWCGJQShowMessage.JQShowMessageOptions.Labels.OK := 'ADD';
IWCGJQShowMessage.JQShowMessageOptions.OnCancel.OnEvent := nil;
IWCGJQShowMessage.JQShowMessageOptions.OnConfirm.OnEvent := ConfirmAddFilterTagEvent;
IWCGJQShowMessage.Theme := jqsmthBootstrap;
IWCGJQShowMessage.ShowPromptMessage('Please enter new filter tag:', '');

Code for capture:

procedure TfContactsSummary.ConfirmAddFilterTagEvent(Sender: TObject; AParams: TStringList);
var
LName: string;

begin
LName:= AParams.Values['str'];
IWCGJQShowMessage.ShowNotification('You''ve clicked OK and your name is: '+ LName, jqsntSuccess);
end;

Cheers!
bob9999
 
Posts: 110
Joined: 18 Jan 2019 17:32

by bob9999 » 07 Mar 2019 01:05

I see what occurred for capturing the prompt result. The OnConfirm event in the show message component has to be SendAllArguments := true for the prompt to be captured. I was sifting through the demo and saw this flag being set. A suggestion is to have default properties set for things to work as the component is added to the form. That was a long time to find this flag that should have been defaulted on in my humble opinion. Something I will never remember so I have added in code in my software so then when I clone in future these exception rules for things to work will be propagated. Cheers!
bob9999
 
Posts: 110
Joined: 18 Jan 2019 17:32


Return to JQShowMessage

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.