Search these areas:
Help
Support Forums
Product Info



-Introduction
-DataWeb: What's New
-Creating an Application
-The DataWeb Designer
-Application Management
-Data Tables
-Data Tables
-Views
-Templates
-Components
-Data Analysis
-Members
-Security
-Importing
-Exporting
-FTP
-JavaScript
-Object Model
-Full-Text Search
-Domain and Email Hosting
-HotBlock Modules
-Account Management
-Glossary
-New Responsive UI Module





DataWeb Help
Support Forums
Tutorial
Script Library
Knowledge Base

Home > Support

Support Forum



Action button click always leaves the current page?
jennifer asked:
On my main view, I have an action button that is supposed to pop up a small window with totals when clicked. I set the href of the button to "javascript:window.open(...)". When I click on the action button, the popup window shows up, but the main window moves on to a new page with the "javascript:window.open(....)" as the URL and "[object]" as the only text on the page. Is there any way to keep the old window from moving to this new page?
Using just javascript & HTML, setting href="#" and onclick="javascript:window.open(...) seems to work for a link (<a>) tag, but not for the ws:action tag.
 
  jimbov responded:
  Currently there isn't any way to specify an emittable onclick attribute for the <ws:action> tag. <ws:action> processing will this attribute. If you really need a button and a link won't do it for you, try adding some inline HTML to your <ws:actionbar>:

<input type="button" onclick="javascript:window.open(....)" name="whatever" value="open window"/>
 
  jimbov responded:
  Probably obvious but that last response is missing "ignore" as in "<ws:action processing will _ignore_ this attribute"  
  brendanx responded:
  Well, buttons don't have href's so maybe you are talking about a link?

Frequently in such situations, to avoid having the browser actually navigate, you must return "false" from the handle.  So your code might just work, if you change it to:

"javascript:window.open(...); return false;"

For links, I tend to use a bogus href, and an onclick handler:

<a href="/" onclick="window.open(...); return false;">

This definitly works on Netscape and IE.
 
  dougl responded:
  DataWeb considers this issue closed.
If you have additional questions or comments about this issue, please open it again.
If you have questions about a different topic please open a new support question.

Thanks,
DataWeb Support
 
  Please Log On
or create your own DataWeb Account.
Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
DataWeb, 720 North 10th Street, A #145, Renton, Washington 98057 *425-583-5970* Fax 484-770-4706* Email Us