• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 185
  • Last Modified:

$$Return on the web

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
snocross
Asked:
snocross
1 Solution
 
HemanthaKumarCommented:
Bset method is to use http_referer in the document and your $$Return field would be

"[" + http_referer + "]"

~Hemanth
0
 
CRAKCommented:
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
 
zvonkoCommented:
Hello Sno,

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

Regards,
zvonko
0
Industry Leaders: 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!

 
snocrossAuthor Commented:
Ok, I will test your ideas... thanks.
0
 
snocrossAuthor Commented:
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
 
zvonkoCommented:
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
 
snocrossAuthor Commented:
That worked beatifully, thank-you.  Thanks to everyone else for their suggestions too.
0
 
zvonkoCommented:
thanks for the points and for the feedback Sno <|;-)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now