Page 1 of 1
Sub Menu Items Problem

Posted:
12 Mar 2014 18:49
by Aggie85
Howdy All!
If a root menu item (top) has submenu items, opening the root item causes a NEW SESSION INSTANCE!!! This also happens in the JQueryDemoIW_V2 y'all supply.
How can I fix this? I need to keep within the same active session.
Thanks in advance!
Aggie85
Re: Sub Menu Items Problem

Posted:
12 Mar 2014 19:29
by Alexander Bulei
Hi Aggie85,
We can't confirm it!
Check your code, maybe you have OnClick assigned on that menu item with Ajax = False.
Best Regards.
Re: Sub Menu Items Problem

Posted:
12 Mar 2014 19:33
by Jorge Sousa
we noticed that
Intraweb creates a new session if the links are invalid, but thats not our responsability.
Re: Sub Menu Items Problem

Posted:
12 Mar 2014 19:41
by Jorge Sousa
Also
We found out that in these cases, Intraweb creates a temporary session, that is destroyed immeadiatelly after the request for a unexistent file is created
And also, that's why we've in our demos the following in ServerController.OnNewSession
procedure TIWServerController.IWServerControllerBaseNewSession(ASession: TIWApplication; var VMainForm: TIWBaseForm);
begin
if GSessions.IsValidSession(ASession) then
ASession.Data := TIWUserSession.Create(ASession);
end;
Re: Sub Menu Items Problem

Posted:
12 Mar 2014 19:52
by Jorge Sousa
We found out that in these cases, Intraweb creates a temporary session, that is destroyed immeadiatelly after the request for a unexistent file is created
And also, that's why we've in our demos the following in ServerController.OnNewSession
procedure TIWServerController.IWServerControllerBaseNewSession(ASession: TIWApplication; var VMainForm: TIWBaseForm);
begin
if GSessions.IsValidSession(ASession) then
ASession.Data := TIWUserSession.Create(ASession);
end;
All of this only happens in IW12
Re: Sub Menu Items Problem

Posted:
12 Mar 2014 20:16
by Aggie85
Thanks for the quick answer but I still think this is a bug somewhere.
Just do the following:
1) Compile and run your demo JqueryDemoIW14_V2.
2) Set a break point in the ServerController's OnNewSession event.
3) Click on the Menu item in the accordion panel.
4) Click on any of the root items #2 to #4 to drop down the submenu.
You will see a new session started. This cannot be right or it honestly makes the submenu feature practically useless for most session based apps!
If you client to open Root 1 submenu on your demo, it does NOT cause a new session to open!
Again, this is y'alls UNMODIFIED / RUNNING demo application (no changes by me)!
Thanks,
Aggie85
Re: Sub Menu Items Problem

Posted:
12 Mar 2014 20:17
by Jorge Sousa
Ok
Final conclusion:
Both in IW12 and IW14, if we set ServerController.AllowMultipleSessionPerUser = True
It creates new sessions when the link to be served is invalid, any link, any control
In IW12, it creates a temporary session, and we can use not GSessions.IsValidSession to determine that it's a temporary session, and the session is destroyed immeadiatelly after the bad link request is processed.
IW14, doesn't have the concept of temporary sessions anymore, so it creates a normal session that will be only destroyed when it's timeout period is reached.
The follow demos were submitted to our friend Alexandre Machado @ Atozed.
I rest my case!
Re: Sub Menu Items Problem

Posted:
12 Mar 2014 20:29
by Aggie85
cgdevtools_support wrote:Ok
Final conclusion:
Both in IW12 and IW14, if we set ServerController.AllowMultipleSessionPerUser = True
It creates new sessions when the link to be served is invalid, any link, any control
In IW12, it creates a temporary session, and we can use not GSessions.IsValidSession to determine that it's a temporary session, and the session is destroyed immeadiatelly after the bad link request is processed.
IW14, doesn't have the concept of temporary sessions anymore, so it creates a normal session that will be only destroyed when it's timeout period is reached.
The follow demos were submitted to our friend Alexandre Machado @ Atozed.
I rest my case!
I will try in my code to have an event set... I was just experimenting when I noticed the new session. That is why I went and ran the unmodified version of y'alls demo. If I can fix it with a valid OnClick event, then great. If not, I will have to come up with a different solution for the short time because I can't be creating new sessions that will eventually time out for what I am trying to use it for.
Thanks for the help and explanation.
Aggie85
Re: Sub Menu Items Problem

Posted:
12 Mar 2014 20:38
by Jorge Sousa
Now about the Menu Items
The problem is that when you don't define an image, it's setting itself a link to /blank.gif
Please copy wwwroot/css/blank.gif to wwwroot/blank.gif while you wait for a next release
However we've indications from Atozed that they already fixed this for the next new version.
Re: Sub Menu Items Problem

Posted:
12 Mar 2014 20:44
by Aggie85
cgdevtools_support wrote:Now about the Menu Items
The problem is that when you don't define an image, it's setting itself a link to /blank.gif
Please copy wwwroot/css/blank.gif to wwwroot/blank.gif while you wait for a next release
However we've indications from Atozed that they already fixed this for the next new version.
Funny how things work! I was just getting ready tell tell you how to "fix" the problem as I have been experimenting and found that if a submenu item's image didn't have any value, it caused the problem!!!
Well, like I said before, as long as I know how to fix a problem, I am happy to be able to move on!
Thanks,
Aggie85