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



how do I get the template to appear when responding from a script?
mike asked:
This is probably one of those "duh... of course" questions, but here goes anyway...

I have a webcallable .ws function that sends an email POSTed to it. At the end, I'd like to display a success/fail page that has my standard template info in it.  If I just use <ws:tags> then it emits the html, but doesn't do the processing needed for the:

    <ws:viewinfo version="1" masterpage="/Themes/template.view"  />

statement to be processed - it just appears in the output html and is ignored by the browser.

I know I could set up a separate .view file (or two) and redirect to it, but I wonder if I can avoid that?

thx!
 
  dougl responded:
  Here's one way to do it:

In your script...
webcall function sendEmail(...)
{
...
var strMailSent = "?sent=";
if ( myEmail.send() )
   strMailSent += "true";
else
   strMailSent += "false";

response.setRedirect( "..." + strMailSent );
return false;
}

in your view:
<ws:htmlblock visible="#request.getParameter( 'sent', '' ) == 'true';#">
Your mail has been sent
</ws:htmlblock>
<ws:htmlblock visible="#request.getParameter( 'sent', '' ) != 'true';#">
Something went terribly wrong!! Run! Run!! Don't worry about me, save yourself!!
</ws:htmlblock>
 
  dougl responded:
  I just read the part about you wanting to avoid redirecting to another view... Sorry.

Wouldn't it be great if we had a method on the Response object that would render a view? Maybe if you knew someone who might know something about an undocumented feature...
 
  mike 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