Solved

$$Return on the web

Posted on 2001-07-12
8
178 Views
Last Modified: 2013-12-18
I'm trying to fix someones database.  They use a $$Return field in a form to return to a previous view where they came from:

go1 := "<script>history.go(-2);</script>";
go2 := "<script>history.go(-3);</script>";
@If(@IsNewDoc;go1;go2)

They do this so they don't have to hardcode a view name in the $$Return field because they could have came from a number of different views.  This actually works, however when they are returned to the original view it does not REFRESH/RELOAD the view.  Is there a way to make the view refresh?

-Snocross
0
Comment
Question by:snocross
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6278768
Bset method is to use http_referer in the document and your $$Return field would be

"[" + http_referer + "]"

~Hemanth
0
 
LVL 13

Expert Comment

by:CRAK
ID: 6279729
I use a frameset myself.
In the onLoad event of a view's $$Viewtemplate (if you use embedded views, you may just as well put in on the form's or page's onLoad-event) a set a variable in the "top"-level (frameset). As the frameset is never reloaded, the variable is safe there.
I use the variable to count the number of steps to go back in history (view sets variable to 0, forms/pages increase it by 1), or to store the view's actiual URL in.

The variable is read again when a user goes "back" to a view. The counter would actually go back in the history; NOT reload the view. It only avoids the if-construction.
Storing the view's URL, however, would solve your problem: instead of going back, you load that URL again:
location.href=<variable>

I prefer this method over http_referer as -in a number of applications- a "create new document"-button, first brings up a pop-up to allow a user to select a form-type. Http_referer would then refer to that pop-up. In normal situations Hemanth's solution should work just as well!
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6282730
Hello Sno,

how about this:
"[<script>history.go(-"+@If(@IsNewDoc;"2";"3")+");location.reload();</script>]"

Regards,
zvonko
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Author Comment

by:snocross
ID: 6285730
Ok, I will test your ideas... thanks.
0
 
LVL 5

Author Comment

by:snocross
ID: 6340776
Zvonko, I tried your solution but it keeps repeatedly RELOADING the page and I can't get it to stop with pressing CTL+ALT+DEL!
0
 
LVL 10

Accepted Solution

by:
zvonko earned 50 total points
ID: 6342501
shock!!!  :-)

...but to save my wizzard state I propose this:
"[/" + @SubSet(@DbName;-1)+"/"+@SubSet(@ViewTitle;-1)+"]"

<|;-)

(of corese this is working only if you select one document from a view and then after doing some steps press  on a button containing something like:
@Command([FileSave]);
@Command([FileCloseWindow])

If you do not come into the document from a view but perhaps from ?OpenForm, than above $$Return formula opens simply the database...

Is this OK for you?

Greetings,
zvonko

0
 
LVL 5

Author Comment

by:snocross
ID: 6380253
That worked beatifully, thank-you.  Thanks to everyone else for their suggestions too.
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6394627
thanks for the points and for the feedback Sno <|;-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…

730 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