Solved

On Cancel button click, return to view name passed in query string

Posted on 2006-11-13
8
361 Views
Last Modified: 2013-12-18

I have a form that I am trying to return to a certain view when either the Submit, Update or Cancel buttons are pressed. I pass the viewname as a query string parameter and have a field on the form called ViewName (code below).

In the cancel button I have the following code:
@URLOpen(Path +"/" +@Text(ViewName) + "?OpenView&RestrictToCategory=" + Component)

The ViewName field works because I can display it on the page, however when I click the Cancel button, the ViewName field returns an empty string, causing the URLOpen to fail. Why would this be? How can I resolve this problem?

thanks


ViewName code
-------------------
Parameter := "viewname";
NotFound := "";
ArgNames := @Left(@Explode(@Right(Query_String_Decoded;"&");"&");"=");
ArgValues := @Right(@Explode(@Right(Query_String_Decoded;"&");"&");"=");

REM "Check that the parameter exists";
Position := @Member(Parameter; ArgNames);

@If(Position > 0;
     @Trim(@Subset(@Subset(ArgValues; Position); -1));
     NotFound
)
0
Comment
Question by:jacy_m
  • 4
  • 3
8 Comments
 

Author Comment

by:jacy_m
ID: 17935852
Note, I also have the following code on the cancel button
Path := "/" + @ReplaceSubstring(@Subset(@DbName; -1); "\\"; "/");
0
 
LVL 19

Assisted Solution

by:madheeswar
madheeswar earned 150 total points
ID: 17936274
You can create a $$Return field which does this redirect based on a if condition.

Even you can pass the view name from the Query String as well.
0
 

Author Comment

by:jacy_m
ID: 17936771
I have never used a $$Return field before. Would I put the same code I had in the cancel button? Or do I need to refer to the Query String variable in a different way to make it work?
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17937007
I think you might be mistaken in the moment of evaluation of the code in the Cancel-button. I assume that, at that moment, Viewname isn't computed (yet).

You could put Viewname explicitly in the QueryString, passing it as a parameter to your form.

For an alternative to
    Path := "/" + @ReplaceSubstring(@Subset(@DbName; -1); "\\"; "/");
see the @WebDbName function (if you have R6)
0
 

Author Comment

by:jacy_m
ID: 17940918

sjef_bosman:
I am passing "viewname" in the QueryString as a named parameter, which I am then using the field ViewName to reference (see code in my 1st post). I am a little unsure at what stage it becomes computed or not.

I am using R5 but thanks for your alternative though.

Sorry for any confusion... I am not a Lotus Developer, I am a VB developer and have been thrown into this job with some mixed results.
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 150 total points
ID: 17941407
You might have to get Viewname out of the REAL Url, using JavaScript. Formula language is only interpreted on the Domino server. I'd have to have a hands-on example to be able to really help you.

Is Viewname a hidden field? Then you might not have it available on the form. An alternative would be to use the option in the Form Properties to Generate HTML for all fields (if it's available in R5). You're certain then that Viename exists in the browser as a field, and that you can assign a value to it using JavaScript.
0
 

Author Comment

by:jacy_m
ID: 17943311
I have managed to solve this using the details on the following page http://www.scottgood.com/jsg/blog.nsf/d6plinks/SGOD-6C3F6U

But instead of using a WebQuerySave, I just placed the javascript window.location change code directly into a $$Return field.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17945366
Thanks, also for the link!
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

777 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