<?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>TechieDan &#187; Framework</title>
	<atom:link href="http://techiedan.com/tag/framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://techiedan.com</link>
	<description>Your Search for The Tech Stuffs</description>
	<lastBuildDate>Tue, 22 May 2012 08:10:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Multiple Values Form:Select in Spring Java</title>
		<link>http://techiedan.com/2009/11/17/multiple-values-form-select-spring-java/</link>
		<comments>http://techiedan.com/2009/11/17/multiple-values-form-select-spring-java/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 09:03:34 +0000</pubDate>
		<dc:creator>techieDan</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Spring 2.5]]></category>

		<guid isPermaLink="false">http://techiedan.com/?p=663</guid>
		<description><![CDATA[<p>Have been searching how to do multiple values in Spring.</p>
<p><strong>What is Spring?</strong></p>
<p><a title="Spring Java" href="http://www.springsource.org/" target="_blank"></a></p>
<p>There are no complications when displaying only a single id or a value while using spring and form taglib by doing this.</p>
<p>&#60;form:select path=&#8221;prospect.wholeSaleId&#8221; items=&#8221;${List}&#8221;
itemLabel=&#8221;wholeSaleId&#8221; itemValue=&#8221;wholeSaleId&#8221;&#62;</p>
<p>Now itemLabel would display the wholeSaleId value. The problem now is how to display let&#8217;s say [...]]]></description>
			<content:encoded><![CDATA[<p>Have been searching how to do multiple values in Spring.</p>
<p><strong>What is Spring?</strong></p>
<p><a title="Spring Java" href="http://www.springsource.org/" target="_blank"><img class="alignnone size-full wp-image-672" title="Spring Java" src="http://techiedan.com/wp-content/uploads/2009/11/spring-java.jpg" alt="Spring Java" width="400" height="174" /></a></p>
<p>There are no complications when displaying only a single id or a value while using spring and form taglib by doing this.</p>
<blockquote><p>&lt;form:select path=&#8221;prospect.wholeSaleId&#8221; items=&#8221;${List}&#8221;<br />
itemLabel=&#8221;wholeSaleId&#8221; itemValue=&#8221;wholeSaleId&#8221;&gt;</p></blockquote>
<p>Now itemLabel would display the wholeSaleId value. The problem now is how to display let&#8217;s say wholeSaleId &#8211; CustomerName in the itemLabel. One workaround is to use the &lt;c:forEach&gt; core taglib.</p>
<blockquote><p>&lt;form:select path=&#8221;prospect.wholeSaleId&#8221;&gt;<br />
&lt;c:forEach items=&#8221;${List}&#8221; var=&#8221;prospect&#8221;&gt;<br />
&lt;form:option value=&#8221;${prospect.wholeSaleId}&#8221;&gt;&lt;c:out value=&#8221;${prospect.wholeSaleId}&#8221;/&gt; &#8211; &lt;c:out value=&#8221;${prospect.companyName}&#8221;/&gt;&lt;/form:option&gt;<br />
&lt;/c:forEach&gt;<br />
&lt;/form:select&gt;</p></blockquote>
<p>Now by doing so, you are now able to display two value. The HTML equivalent of such will now display like this. (<em>Assuming it has only 3 values</em>)</p>
<blockquote><p>&lt;select name=&#8221;wholeSaleId&#8221;&gt;<br />
&lt;option value=&#8221;wholeSaleIdValue1&#8243;&gt;wholeSaleIdValue1 &#8211; companyName1&lt;/option&gt;<br />
&lt;option value=&#8221;wholeSaleIdValue2&#8243;&gt;wholeSaleIdValue2 &#8211; companyName2&lt;/option&gt;<br />
&lt;option value=&#8221;wholeSaleIdValue3&#8243;&gt;wholeSaleIdValue3 &#8211; companyName3&lt;/option&gt;<br />
&lt;/select&gt;</p></blockquote>
<p>So there you have it. A workaround for the form tag in Spring Framework.</p>
]]></content:encoded>
			<wfw:commentRss>http://techiedan.com/2009/11/17/multiple-values-form-select-spring-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

