Solved

Return to previous webpage

Posted on 2002-05-07
18
202 Views
Last Modified: 2013-12-18
A while back I had a problem where I was trying to return the user to the previous page they were in and Zvonko gave me a solution:

Click here if you want to see original question:
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?qid=20150041


Anyway his solution was placing this code in my $$Return

"[/" + @SubSet(@DbName;-1)+"/"+@SubSet(@ViewTitle;-1)+"]"


This worked great accept now I have a user who has expanded several categories in a view to find a specific document, and when they open the document and then save the document the $$Return brings them back to the original view successfully however the view categories are not returned to the same state that they were in... ie: some categories should be left expanded, and some should be left collapsed etc.  Instead it is auto-expanding EVERYTHING.

Any ideas to return the view to exactly how the user left them?
0
Comment
Question by:snocross
  • 6
  • 5
  • 2
  • +3
18 Comments
 
LVL 9

Expert Comment

by:Arunkumar
Comment Utility
Hi Sno !

:-)
0
 
LVL 5

Author Comment

by:snocross
Comment Utility
Howdy friend!  That was fast!
0
 
LVL 10

Expert Comment

by:zvonko
Comment Utility
Hi Sno!

Hello Arun, I have posted a proposal to your dsk problem :)

Sorry Sno that I got a bit quiet at last time, but I am overworked :)

For your view state problem is a CGI variable HTTP_REFFERER to be used. But to get exact scenario I have to test a bit.

Is this view to be reopend displayed in applet or html mode?


0
 
LVL 5

Author Comment

by:snocross
Comment Utility
Hi Zvonko,

HTML mode.
0
 
LVL 10

Expert Comment

by:zvonko
Comment Utility
OK, I test my idea and come back again...

So long,
zvonko

0
 
LVL 5

Author Comment

by:snocross
Comment Utility
Sounds good!
0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
Sno, The solution was already available in the thread . Check out for my comment in the link.

~Hemanth
0
 
LVL 10

Expert Comment

by:zvonko
Comment Utility
I got it Sno!

Here it goes.
Create two fields on your document form.
One field name has to be: HTTP_REFERER
For the next (to the right side) field is the name not important, but I sugest this name: LastView
The formula for LastView has to be this:
FIELD HTTP_REFRER:=HTTP_REFERER;
FIELD LastView:=LastView;
@If(@Contains(HTTP_REFRER;"?OpenView");@SetField("LastView";HTTP_REFERER);"")

So you can use the value of the field LastView in your $$Return field like this:
FIELD LastView:=LastView;
"["+LastView+"]"

Important note is to set Form property: GenerateHtmlForAllFields

Tell me how it works in your environment.

So long,
zvonko

PS. there a surely some situation not corectly handled, but test this first version. The improved version will follow :-)

0
 
LVL 10

Expert Comment

by:zvonko
Comment Utility
Hi Heman,

the Http_Referer alone is not the solution because every document refresh or recalculation set the Http_Referer to the previous document link and loose the view link.

In my proposal is the $$Return check not handled when LastView was empty. This I have to test and provide.

0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
Gotcha.
0
 
LVL 9

Expert Comment

by:Arunkumar
Comment Utility
Hey Bro & Buddy !!!

Howdy ?

Bro, I have grooved lots of messages and posts for you.
And whom are you playing chess with ?  Is the next move mine ?

;-)
0
 
LVL 10

Accepted Solution

by:
zvonko earned 50 total points
Comment Utility
Try this formula improvement for $$Return:
FIELD LastView:=LastView;
@If(LastView!="";"["+LastView+"]";
"[/"+@Subset(@DbName;-1)+"/"+@Subset(@ViewTitle;-1)+"]")

0
 
LVL 13

Expert Comment

by:CRAK
Comment Utility
Have you tried my suggestion in the previous discussion?
Simply store the entire views URL in every (viewtemplates?) onLoad-event and allow javascript on documents to retrieve that value and reload it.
It automatically resists document refreshes, reloads, section expansions etc. without a whole lot of effort!
If you're not yet using a frameset: try a simple single frame frameset....
0
 
LVL 10

Expert Comment

by:zvonko
Comment Utility
Hi CRAK,

your JavaScript proposal is a browser client side solution. I would prefer it for page display mode.
But when you post a form to be submited to Domino, then you can not redirect to the View because you have to save document first.

Framset or no frameset does not make difference in this client side redirection concept.

0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
Comment Utility
Listening...
0
 
LVL 13

Expert Comment

by:CRAK
Comment Utility
In cases like this, the use of HTTP_Referer isn't always very suitable: expanding/collapsing sections, refreshing on keyword changes etc. makes you lose track. Can't say that I never use it though!

My approach overcomes that, though it has a different disadvantage: if a category is changed (i.e. new one is added, appearing higher in the view than the expanded category), you'll still get the wrong category opened. In cases where categories can not be user defined, that should be no problem.

Zvonko, I don't understand your remark: yes, it's a browser client side solution, but what's wrong with that? I use document.forms[0].save to, to avoid the problem you describe. No need for $$Return!

I've posted a little demo on my site (will remove it in time): http://home.wanadoo.nl/ralph.kersten/temp/ret2vw.zip (sorry, haven't got a www-domino server). It starts (as indicated) in the frameset.

Suggestions are welcome!

By the way Sno, how did the user expand "several categories" in an HTML-view?
0
 
LVL 5

Author Comment

by:snocross
Comment Utility
There was several groupings and they would click one group at a time until they found their document.  Then when they went back they would have to click the multiple levels of groupings again.
0
 
LVL 5

Author Comment

by:snocross
Comment Utility
This did exactly what I needed.  Thanks everyone!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now