Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2006-11-13
8
Medium Priority
?
373 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
[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
  • 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 600 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 600 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

610 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