Hi,
I have a form with 2 action buttons,
I have set a target of _new for one of them, since I want it to open into a new window.
The button with a target of _new is only opening the same document as in the main window, but using a different form (implemented using a view form formula). The form that opens up is readonly and has SaveOptions set to “0”. So there is no provision for the user to make any modifications here.
The formula for this button is:
Db:=@ReplaceSubstring(@ReplaceSubstring(@Subset(@DbName;-1);“\”;“/”);" “;”%20");
@URLOpen(Db+“/VW_PRINTERFRIENDLY/”+@Text(@DocumentUniqueID)+“?OpenDocument”)
The other button brings up a Web Page Dialog where the user can enter some information and submit the same.
(I have done this using web page dialogs since there are too many rules in the system regarding editing rights than can be easily handled by hide-whens or controlled-access sections)
The javascript code on the submit button in the web page dialog reads:
======
var callerWindowObj = dialogArguments;
//transfer field values to parent
…
callerWindowObj.document.forms[0].submit();
self.close();
======
This should first submit the parent window and then close the Dialog.The $$Return field in the form is also set to take the user back to a view. And this works correctly if the other button does not have the target set to _new.
The problem occurs when I operate in the following sequence:
-
I first click on button 1 (open a new window) and then close it
-
Then I use the other button to open the web page dialog and click the submit button.
When I do this, a new window opens up instead , displaying the same contents as the first button would have displayed(same document with different form). It is almost like the submit is running the same code as the first button.
The dialog box closes, but the parent window is not submitted.
There are no problems if I set the target of the first button to the same window and then navigate back and click on the second button.
I know the problem sounds funny, but this is affecting the overall navigation plan that I had in mind for my application.
If anybody is able to figure out what is going wrong, I would really appreciate it if you could let me know.
thanks in advance,
regards,
Libin