Jump to content

how to create new page without form


billyChou

Recommended Posts

in Demos\Desktop\HTTP Post Callback - Browser Window

 

modify

procedure TMainForm.UniButton1Click(Sender: TObject);

begin

  UniSession.UrlRedirect('http://www.google.com'); // --> it's ok

end;

 

 

add

---------------------------------------------------------------------------

procedure TMainForm.UniFormShow(Sender: TObject);
var
   sJson, sText : string;
   AUrl: string;
begin
  sJson := '';
  sText :=UniApplication.Parameters.Values['json'];
  if sText= 'test' then
  begin
     UniSession.UrlRedirect('http://www.google.com');// -> error halt
 
  end;
end;

 

url test  localhost:8077/?json=test  --> browser halt

 

 

Thanks

Link to comment
Share on other sites

Something locks up when I try this too, who knows why,

can use a timer as a workaround:

 

 

procedure TMainForm.UniFormShow(Sender: TObject);
var
   sJson, sText : string;
   AUrl: string;
begin
  sJson := '';
  sText :=UniApplication.Parameters.Values['json'];
  if sText= 'test' then
  begin
     uniTimer1.Enabled:=true;

  end;
end;

procedure TMainForm.UniTimer1Timer(Sender: TObject);
begin
   UniSession.UrlRedirect('http://www.google.com');//-> no error
   uniTimer1.Enabled:=false;
end;

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...