Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UserSession based ModalWindow
#1
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);
Reply


Messages In This Thread
UserSession based ModalWindow - by tobenschain - 08-05-2020, 11:31 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)