Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 353
  • Last Modified:

Return to predefined URL after submit

R507; webapplication:

In a document or a view, a user clicks on an action, trigering an agent, passing the users current url through the new url:
http://agentUrl?OpenAgent&SourceUrl=originalUrl
The reason is that -later in- I want to return there.

The agent creates a document in a different database, sets a few fields and saves. Then an new url is composed to open that new documention editmode and -again- passing the original url:
http://newdocUrl?EditDocument&SourceUrl=originalUrl

After filling out some additional fields, the user presses a submit action. The authornames field is now given a different value (the user is not allowed to re-edit the document) and the document is actually submitted.

All this happens in javascript. The annoying thing is that I can't both save the docuemnt and return to the original url (preferably using location.assign()). It's no problem isolating originalURL but when I address it, the doc appears unsaved -even after adressing is AFTER submitting!-. When I only submit (save) the document, the form's action is triggered: the ?EditDocument, logically resulting in an error.

$$Return seems to have no effect on the forms action or what happens.
The onSubmit-event is added to the <FORM>-tag, but has no effect either.

I have done this before. What am I doing wrong this time?
0
CRAK
Asked:
CRAK
  • 5
  • 3
  • 2
  • +1
1 Solution
 
HemanthaKumarCommented:
At the end of the agent after everything is executed and doc is saved, Execute a print statement like this

Print "[www.Domain.com]"

This will open the page domain.com, this url can be relative too.

Goodluck
~Hemanth
0
 
CRAKAuthor Commented:
Sorry Hemanth, I know the technique (used it to open the doc in edit mode), but it does not work here....
As I said: I've done it before; there must be something really weird going on here!

In my keyboard as well.... so many typing errors in my question. Can't be me! ;-))


Anyway....
I'll try to involve WebQuerySave: that's the only LOGICAL thing that I haven tried yet. Will let you know tomorrow.
0
 
zvonkoCommented:
Hello CRAK,

perhaps you mess this: the correct action for storing a document is not ?EditDocument ;-))
The correct one is: ?ComposeDocument

Regards,
zvonko
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.

 
HemanthaKumarCommented:
0
 
CRAKAuthor Commented:
zvonko,
The document was already created and saved in the back-end. The user only has to fill out one or two additional fields. ?ComposeDocument would create ANOTHER new document.


But I've worked thinks out last night. That URL that is supposed to bring back my original page is retrieved (in javascript) from the URL, using Query_String. In e.g. http://newdocUrl?EditDocument&SourceUrl=originalUrl I locate "&Source=", keep everything trailing it and discard the rest. Then I add "&" at the end, locate the first "&" (more parameters MAY be entered) and isolate everything preceding it, using myUrl.substring(start, end).

The error I made resulted in end=0.

Simple stupidity....

Sorry guys.... mind if I delete this question?
0
 
zvonkoCommented:
hey, from my side, I do not mind at all <|;-)

Allow me only one joke: the most errors sit in front of the keyboard :-))
0
 
CRAKAuthor Commented:
I'll check with my parents.... see if they can get my bugs fixed ;-o
0
 
CRAKAuthor Commented:
Why did you change your name?
0
 
zvonkoCommented:
this name change was a bug fix ;-)

when I was creating my EE account in 1998 I was checking only the account "Zvonko" (my FirstName). It was in use, so I choose this stupid synonym (stamp, ha ha).
Now I have to pay for this ;-)
The Proppercase name was registered by an Croatian who newer posted nor asked for eneything. But the EE comunity support told me: it is not a problem; take the first letter lowercase and it will work. So, I start now from scratch. Transfering expert points and history is still not possible in EE (I meen: renaming stamp to zvonko). Only offer from EE was to give me question points from stamp...
0
 
CRAKAuthor Commented:
I found solution myself. The problem wasn't caused by some unexpected program behaviour, but by a simple typing error.

I don't think others will learn a great deal from a silly thing like that.

I can't reward points to either of the participants: I am sure that they both know how to solve a problem as described, but:
- neither mentioned "typing error", and
- rewarding one would be unfair to the other

Thanks
0
 
NetminderCommented:
Points refunded and question closed per user request (user resolved question).

Netminder
Community Support Moderator
Experts Exchange
0

Featured Post

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!

  • 5
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now