Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: I'm trying to create my own InputQuery unsuccessfully


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Mar 29, 2018 4:01 AM Last Post By: Jose Nilton Pace Threads: [ Previous | Next ]
DAVID IZADA ROD...

Posts: 2
Registered: 7/28/06
I'm trying to create my own InputQuery unsuccessfully  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 28, 2018 4:57 PM
I need to create several standard message dialogs like InputQuery for migrating an application to IntraWeb.
After looking at the demo ModalWindow, I tried to use it for creating the first modal dialog, something similar to InputQuery.

I tried running the project but I don't see any message box.

My source in the frame/form (tried both) is:

function InputQuery(const ACaption, APrompt : string; out Value : string) : boolean;
var
iqFrame : TfrmInputQuery;
begin
iqFrame := TfrmInputQuery.Create(GGetWebApplicationThreadVar.ActiveForm);
try
Result := iqFrame.InputQuery(ACaption, APrompt, Value);
finally
iqFrame.Free;
end;
end;

function TfrmInputQuery.InputQuery(const ACaption, APrompt: string; out Value: string): boolean;
begin
Caption := ACaption;
lblPrompt.Caption := APrompt;

ShowRegion(APrompt, IWFrameRegion);

Result := FResult;
if Result then
Value := FValue;
end;

procedure TfrmInputQuery.IWModalWindow1AsyncClick(Sender: TObject; EventParams:
TStringList);
begin
if IWModalWindow1.ButtonIndex = 1 {OK} then
begin
FResult := true;
FValue := edtText.Text;
end;
end;

procedure TfrmInputQuery.ShowRegion(const ATitle: string; ARegion: TIWRegion);
begin
with IWModalWindow1 do
begin
Reset;
Buttons.CommaText := '&OK,&Cancel';
Title := ATitle;
ContentElement := ARegion;
OnAsyncClick := IWModalWindow1AsyncClick;
FriendlyName := 'mydlg';
CloseButtonVisible := true;
CloseOnEscKey := true;
Show;
end;
end;
Dan Barclay

Posts: 889
Registered: 11/9/03
Re: I'm trying to create my own InputQuery unsuccessfully  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 28, 2018 6:29 PM   in response to: DAVID IZADA ROD... in response to: DAVID IZADA ROD...
DAVID IZADA RODRIGUEZ wrote:
I need to create several standard message dialogs like InputQuery for migrating an application to IntraWeb.
After looking at the demo ModalWindow, I tried to use it for creating the first modal dialog, something similar to InputQuery.

I tried running the project but I don't see any message box.

My source in the frame/form (tried both) is:

function InputQuery(const ACaption, APrompt : string; out Value : string) : boolean;
var
iqFrame : TfrmInputQuery;
begin
iqFrame := TfrmInputQuery.Create(GGetWebApplicationThreadVar.ActiveForm);
try
Result := iqFrame.InputQuery(ACaption, APrompt, Value);
finally
iqFrame.Free;
end;
end;

function TfrmInputQuery.InputQuery(const ACaption, APrompt: string; out Value: string): boolean;
begin
Caption := ACaption;
lblPrompt.Caption := APrompt;

ShowRegion(APrompt, IWFrameRegion);

Result := FResult;
if Result then
Value := FValue;
end;

procedure TfrmInputQuery.IWModalWindow1AsyncClick(Sender: TObject; EventParams:
TStringList);
begin
if IWModalWindow1.ButtonIndex = 1 {OK} then
begin
FResult := true;
FValue := edtText.Text;
end;
end;

procedure TfrmInputQuery.ShowRegion(const ATitle: string; ARegion: TIWRegion);
begin
with IWModalWindow1 do
begin
Reset;
Buttons.CommaText := '&OK,&Cancel';
Title := ATitle;
ContentElement := ARegion;
OnAsyncClick := IWModalWindow1AsyncClick;
FriendlyName := 'mydlg';
CloseButtonVisible := true;
CloseOnEscKey := true;
Show;
end;
end;

I don't have time to go through it line by line right now, but one common miss here is failure to set "RenderInvisibleControls" property to True on your dialog (don't ask me how I know).

Easy to check. "View Source" and see if your dialog was sent to the client.

These dialogs are shown by the client and the components must already be there before they can be shown.

If I get a few minutes I'll see what else may be an issue, if this isn't it.

Dan

Edited by: Dan Barclay on Mar 28, 2018 8:29 PM
DAVID IZADA ROD...

Posts: 2
Registered: 7/28/06
Re: I'm trying to create my own InputQuery unsuccessfully  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 28, 2018 7:18 PM   in response to: Dan Barclay in response to: Dan Barclay
RenderInvisibleControls is true.
I cannot ask for the source because I never get anything in addition to the form with the button I used to trigger the InputQuery.

If I debug the code, it goes up to the Show for the ModalWindow, but I never get any dialog.

My code looks like the ModalWindow demo, but it just doesn't work.
Jose Nilton Pace


Posts: 122
Registered: 5/15/98
Re: I'm trying to create my own InputQuery unsuccessfully  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 29, 2018 4:01 AM   in response to: DAVID IZADA ROD... in response to: DAVID IZADA ROD...
Hi David, did you try use: WebApplication.ShowPrompt(); ?
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02