Atozed Forums
UserSession based ModalWindow - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: UserSession based ModalWindow (/thread-1848.html)



UserSession based ModalWindow - tobenschain - 08-05-2020

I am trying to call a routine that works like windows' MessageDlg. My call to showMsg does not show modal window.

Code:
procedure TIWUserSession.WindowDoOnAsyncClick(Sender: TObject; EventParams: TStringList);
var
  BtnCaption: string;
begin
  if ModalWin.ButtonIndex >= 0 then begin
    BtnCaption := ModalWin.Buttons[ModalWin.ButtonIndex-1];
    // First ButtonIndex is 1, not 0
    BtnCaption := StringReplace(BtnCaption, '&', '', [rfReplaceAll]);
    WebApplication.ShowMessage('You clicked on button: ' + BtnCaption);
  end;
end;

Code:
procedure TIWUserSession.ShowRegion(const ATitle: string; ARegion: TIWRegion); // this routine is executed
begin
  with UserSession.ModalWin do begin
    Reset;
    Buttons.CommaText := '&OK,&Cancel';
    Title := ATitle;
    ContentElement := ARegion;
    OnAsyncClick := WindowDoOnAsyncClick;
    Show;
  end;
end;

Code:
procedure showMsg;
  ShowYNFormw := TShowYNForm.Create(WebApplication);
  UserSession.ShowRegion('test',ShowYNFormw IWRegion1);



RE: UserSession based ModalWindow - Jose Nilton Pace - 08-05-2020

Hi, look this demo: https://github.com/Atozed/IntraWeb/tree/master/XIV/Delphi/ModalWindow


RE: UserSession based ModalWindow - tobenschain - 08-05-2020

yes but it has a modal window tied to one form. I have 50 forms that need modal window that works like windows' MessageDlg. It needs modal window in UserSession.