<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ReadyState4 &#187; DWR</title>
	<atom:link href="http://readystate4.com/category/dwr/feed/" rel="self" type="application/rss+xml" />
	<link>http://readystate4.com</link>
	<description>JavaScript, Web Development, Ruby, and Technology.</description>
	<lastBuildDate>Fri, 27 Jan 2012 18:37:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Making a synchronous DWR call</title>
		<link>http://readystate4.com/2008/09/18/making-a-synchronous-dwr-call/</link>
		<comments>http://readystate4.com/2008/09/18/making-a-synchronous-dwr-call/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 18:26:21 +0000</pubDate>
		<dc:creator>Mauvis</dc:creator>
				<category><![CDATA[DWR]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://readystate4.com/2008/09/18/making-a-synchronous-dwr-call/</guid>
		<description><![CDATA[It took me about half an hour of Googling to find this, and I couldn&#8217;t readily find this in the DWR documentation. Hopefully this may save someone some time: To make a DWR call synchronous (meaning browser-blocking) you must pass an object as one of the arguments of your DWR call with a property async [...]]]></description>
			<content:encoded><![CDATA[<p>It took me about half an hour of Googling to find this, and I couldn&#8217;t readily find this in the <a href="http://directwebremoting.org/dwr/documentation">DWR documentation</a>. Hopefully this may save someone some time:</p>
<p>To make a DWR call synchronous (meaning browser-blocking) you must pass an object as one of the arguments of your DWR call with a property <code>async</code> set to <code>false</code>.</p>
<p>I needed this feature in project where a collection object sends out a call for more data if it didn&#8217;t have it:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">...
_getData<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>offset<span style="color: #339933;">,</span> limit<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> r<span style="color: #339933;">;</span>
    DWRcomponent.<span style="color: #660066;">getComments</span><span style="color: #009900;">&#40;</span>offset<span style="color: #339933;">,</span> limit<span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span> 
        async<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
        callback<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            r <span style="color: #339933;">=</span> toJSON<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'('</span> <span style="color: #339933;">+</span> s <span style="color: #339933;">+</span> <span style="color: #3366CC;">')'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
    <span style="color: #000066; font-weight: bold;">return</span> r<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
...</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://readystate4.com/2008/09/18/making-a-synchronous-dwr-call/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

