<?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>Technotrance, Illusions and Perspectives &#187; dwr</title>
	<atom:link href="http://myblog.shriharisc.com/tag/dwr/feed/" rel="self" type="application/rss+xml" />
	<link>http://myblog.shriharisc.com</link>
	<description>A dose of everyday bruises with Java/JEE</description>
	<lastBuildDate>Mon, 02 Aug 2010 17:45:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using enums in DWR to populate select or multi-select</title>
		<link>http://myblog.shriharisc.com/2009/07/06/using-enums-in-dwr-to-populate-select-or-multi-select/</link>
		<comments>http://myblog.shriharisc.com/2009/07/06/using-enums-in-dwr-to-populate-select-or-multi-select/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 18:04:04 +0000</pubDate>
		<dc:creator>Shrihari</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dwr]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://schakrap.wordpress.com/?p=61</guid>
		<description><![CDATA[In case we need to population enumeration data in combo  box or multi-select widgets, in DWR (integrated on Spring), following is the approach:
1) In the spring&#8217;s applicationContext.
a) Add the method which returns the enum entity to &#60;dwr:remote&#62;
b) Add a dwr:convert tag of type &#8216;enum&#8217; (as below)

&#60;dwr:remote javascript=&#34;myoperations&#34;&#62;
   &#60;dwr:include method=&#34;getDataAsEnum&#34;/&#62;
   &#60;dwr:convert type=&#34;enum&#34;/&#62;
&#60;/dwr:remote&#62;

2) [...]]]></description>
			<content:encoded><![CDATA[<p>In case we need to population enumeration data in combo  box or multi-select widgets, in DWR (integrated on Spring), following is the approach:</p>
<p>1) In the spring&#8217;s applicationContext.<br />
a) Add the method which returns the enum entity to &lt;dwr:remote&gt;<br />
b) Add a dwr:convert tag of type &#8216;enum&#8217; (as below)</p>
<pre class="brush: xml">
&lt;dwr:remote javascript=&quot;myoperations&quot;&gt;
   &lt;dwr:include method=&quot;getDataAsEnum&quot;/&gt;
   &lt;dwr:convert type=&quot;enum&quot;/&gt;
&lt;/dwr:remote&gt;
</pre>
<p>2) In the view (jsp) file, you could invoke the following javascript function </p>
<pre class="brush: javascript">
&lt;body onload=&quot;loadEnumeration();&quot;&gt;
function loadEnumeration()
{ myOperations.getDataAsEnum(callbackFunctionHandle);
};
var callbackFunctionHandle = function(data)
{   dwr.util.removeAllOptions(&#039;enum_select&#039;);
     dwr.util.addOptions(&#039;enum_select&#039;,[&#039;--Select--&#039;]);
     dwr.util.addOptions(&#039;enum_select&#039;, data);
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://myblog.shriharisc.com/2009/07/06/using-enums-in-dwr-to-populate-select-or-multi-select/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
