Jump to content

Emulating NewPage. Problem with Sessions


elGringo

Recommended Posts

Hello guys! 

 

Tried to emulate opening a new page in the following way

 

Click to go "another page"

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
UniSession.AddJS('window.location=''http://localhost:8077/?page=AnotherPage '' ');
end;

MainForm.OnShow

procedure TMainForm.UniFormShow(Sender: TObject);
begin
    if UniApplication.Parameters.Values['Page']='AnotherPage' then

    begin
    UnitAnotherPage.AnotherPage.Visible:=true;
    Self.Visible:=false;
    end;
end;

And everything good but!

 

If in the browser to press BackButton UniGUI writes

 

Invalid session or session Timeout.

Restart application

 

So any ideas? How to just back to the MainForm?

 

 

Link to comment
Share on other sites

So, no way to emulate pages with UniGUI? To use back and forward buttons?

 

It is a habbit for many people to use this buttons, if we show another form to user and he wants to back to the previous form, pressing the button - he goes to another page - not UniGUI maybe, so did you meet such situations, how do you manage them?

Link to comment
Share on other sites

I feel decision must be, even if not at the moment, than I wish this feature to be in the future in UniGUI.

I felt the same when I started with UniGUI. Now, 3 years later, it's just something that I have accepted and moved on. Farshad has made it pretty clear that making the back button work as per traditional websites is a non-starter.

 

You can set BackButtonAction to bbWarnUser. If you do this and the user clicks the Back Button, they get a warning that they will be leaving the site if they proceed. Works for me and my users. Also, if people ask I tell them that the Back button is yesterday's technology and that my software is modern, cutting edge using SPA.

  • Upvote 1
Link to comment
Share on other sites

Andy, Zilav, Farshad thank you for your answers and opinions, so any technology has its limitations anyway.

 

Just if you ask your friends do they use back button or not 9 of 10 will answer yes I think so. Of course for the moment I will tell users "Dont press back button or something bad will happen, but i think it is temporary decision"

 

But anyway even if we have one page that is very powerful page)) Full of Delphi spirit and power. And in all other Aspects UniGUI is very clever and well done framework!

 

Hope in future we will have pages anyway)))

 

Regards and good luck to all!!! 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...