Solved

$$Return on the web

Posted on 2001-07-12
8
173 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
8 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
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
Comment Utility
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
Comment Utility
Hello Sno,

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

Regards,
zvonko
0
 
LVL 5

Author Comment

by:snocross
Comment Utility
Ok, I will test your ideas... thanks.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 5

Author Comment

by:snocross
Comment Utility
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
Comment Utility
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
Comment Utility
That worked beatifully, thank-you.  Thanks to everyone else for their suggestions too.
0
 
LVL 10

Expert Comment

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

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

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

9 Experts available now in Live!

Get 1:1 Help Now