Return to last open view - problems

-WEB:- closing a new document I want return to last open view.

First I tried by setting a profile field by Formula in the QueryClose event of the View - without success in Web. I can get the profile field in my new document, but it shows the value last modified in Notes Client.

Alternativ some use a field HTTP_Referer but (because I am using Frames and a $$ViewTemplateDefault) there is no view information inside:

http://mySERVER/myDB.nsf/myPAGEwithNAVIGATORSonLEFT!OpenPage&BaseTarget=myMAINFRAME

Field Path_Info:

/myDB.nsf/myNEWFORM?OpenForm

Additional Info:

I am using a Frameset with 3 Frames like:

  • myTop

  • myLeft

  • myMainframe

New forms are created from a Navigator, may be better from View action?

If I want open the new form not in the MainFrame but all over the Window I need A new Frameset? And what can I do to return to last open View??

Any help will be much appreciated

Subject: return to last open view - problems

2 quick suggestions:

  1. Add the name of the view as an arguement to the URL used to Open the form.

e.g.

…/formname?OpenForm&lastview=lastviewname

Have a C4Display field on the form for the CGI variable QUERY_STRING and then parse out the name of the view from the QUERY_STRING field in a $$return field and use to create a redirection to the view. Remember to use square brackets (or double square brackets for an internal redirection) “

  1. Use javascript to write the value to a cookie and then get the value and set the location.href javascript porperty on submit. This requires the users to allow cookies.

HTH

melissa

Subject: RE: return to last open view - problems

Hi MelissaThanks for your Mail - I am a “Web-Newby” with Notes so every help is a gift.

I have a Navigator with Formula:

tmp:=@Subset(@ViewTitle;1);

@SetTargetFrame(“MainNav”);

@URLOpen(“http://myServer/myDB.nsf/myForm?OpenForm&LastView=” + tmp)

…but it seems to me no value reaches my Form:

Field Query_String - Formula (??):

@UrlQueryString(“LastView”)

…And If I enter a Constant String in my $$Return - Field

“[oneOfMyViews]”

…closing my form will always open the default view??

Subject: return to last open view - problems

This is best done using a session-cookie.

On your $$ViewTemplateDefault, put the following code in the onLoad event

document.cookie = “view” + “=” + location.toString() + “;path=/;”

Now you can always return to the exact URL of the last visited view, by putting a formula of

viewCookie := @Middle(@GetHTTPHeader(“cookie”);“view=”;“;”);

viewTitle := @URLEncode(“Domino”;@Subset(@ViewTitle;-1));

@If(viewCookie != “”;

@URLOpen( @Right(viewCookie;@GetHTTPHeader("host")) );

@If(viewTitle != "";

	@URLOpen("/" + @WebDbName + "/" + viewTitle + "?OpenView");

	@URLOpen("/" + @WebDbName + "/redirect?OpenAgent")

)

)

on your forms (action, hotspot or whatever). The agent “redirect” called as “last try” in the formula above is the startpage for my app, substitute with something suitable.

A nice thing with this is that, if you´re displaying views as html, the return to the view will always open up the correct page, including expanded categories and such.

/Anders

Subject: RE: return to last open view - problems

Thanks very much for your mail, Anders!

Some of our users - I know - dont allow Cookies.

In moment my problem is get a value from html field by formula language see:

http://www-10.lotus.com/ldd/nd6forum.nsf/DateAllThreadedweb/2f81a780ae4b4f8d85256da90050471b?OpenDocument