Solved

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

Posted on 2006-11-13
8
358 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:jacy_m
Comment Utility

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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks, also for the link!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

13 Experts available now in Live!

Get 1:1 Help Now