<?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>betweenGo &#187; Page Development</title>
	<atom:link href="http://betweengo.com/category/atg/page-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://betweengo.com</link>
	<description>We make Ruby on Rails easy.  We make ATG easy.</description>
	<lastBuildDate>Tue, 06 Dec 2011 14:03:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ATG Log Error from JSP Page</title>
		<link>http://betweengo.com/2010/09/27/atg-log-error-from-jsp-page/</link>
		<comments>http://betweengo.com/2010/09/27/atg-log-error-from-jsp-page/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 16:00:00 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Page Development]]></category>
		<category><![CDATA[dsp]]></category>
		<category><![CDATA[Logging]]></category>

		<guid isPermaLink="false">http://betweengo.com/2010/09/27/atg-log-error-from-jsp-page/</guid>
		<description><![CDATA[&#34;The page cannot be displayed&#34; by Peter Kaminski Unlike this IKEA sign, you usually don’t want to display errors on your web pages.&#160; ATG allows you to log errors to the server log from a JSP page.&#160; Below is an example of how to do this.&#160; In this case if we find the price is [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2010/03/26/set-atg-property-and-popup-window-after-clicking-on-link/' rel='bookmark' title='Set ATG Property And Popup Window After Clicking on Link'>Set ATG Property And Popup Window After Clicking on Link</a></li>
<li><a href='http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/' rel='bookmark' title='Size of collection in a JSP/DSP page'>Size of collection in a JSP/DSP page</a></li>
<li><a href='http://betweengo.com/2008/07/04/log-sql-on-atg/' rel='bookmark' title='Log SQL on ATG'>Log SQL on ATG</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/peterkaminski/30196012/"><img style="display: block; float: none; margin-left: auto; margin-right: auto" title="&quot;The page cannot be displayed&quot; | Flickr" alt="&quot;The page cannot be displayed&quot; | Flickr" src="http://farm1.static.flickr.com/23/30196012_d4f0e202b1.jpg" /></a> </p>
<p align="center"><a title="&quot;The page cannot be displayed&quot; | Flickr" href="http://www.flickr.com/photos/peterkaminski/30196012/">&quot;The page cannot be displayed&quot;</a> by <strong><a title="Flick: Peter Kaminski&#39;s Photostream" href="http://www.flickr.com/photos/peterkaminski/">Peter Kaminski</a></strong></p>
<p>Unlike this <a title="IKEA" href="http://www.ikea.com/">IKEA</a> sign, you usually don’t want to display errors on your web pages.&#160; ATG allows you to log errors to the server log from a JSP page.&#160; Below is an example of how to do this.&#160; In this case if we find the price is null we log an error to the server log.</p>
<pre>&lt;dsp:getvalueof id=&quot;price&quot; idtype=&quot;java.lang.Double&quot; param=&quot;currentItem.priceInfo.amount&quot;&gt;&lt;%if (price == null) {  atg.servlet.DynamoHttpServletRequest dreq = atg.servlet.ServletUtil.getDynamoRequest(request);  dreq.logError(&quot;price is null!”);}%&gt;&lt;/dsp:getvalueof&gt;</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2010%2F09%2F27%2Fatg-log-error-from-jsp-page%2F&amp;title=ATG%20Log%20Error%20from%20JSP%20Page" id="wpa2a_2"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2010/03/26/set-atg-property-and-popup-window-after-clicking-on-link/' rel='bookmark' title='Set ATG Property And Popup Window After Clicking on Link'>Set ATG Property And Popup Window After Clicking on Link</a></li>
<li><a href='http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/' rel='bookmark' title='Size of collection in a JSP/DSP page'>Size of collection in a JSP/DSP page</a></li>
<li><a href='http://betweengo.com/2008/07/04/log-sql-on-atg/' rel='bookmark' title='Log SQL on ATG'>Log SQL on ATG</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2010/09/27/atg-log-error-from-jsp-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set ATG Property And Popup Window After Clicking on Link</title>
		<link>http://betweengo.com/2010/03/26/set-atg-property-and-popup-window-after-clicking-on-link/</link>
		<comments>http://betweengo.com/2010/03/26/set-atg-property-and-popup-window-after-clicking-on-link/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 23:55:21 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Page Development]]></category>
		<category><![CDATA[dsp]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://betweengo.com/2010/03/26/set-atg-property-and-popup-window-after-clicking-on-link/</guid>
		<description><![CDATA[la cuarta ventana by bachmont&#160; Sometimes when you click on a link in an ATG JSP/DSP page you want a property of an ATG component to be set as well.&#160; For example: &#60;dsp:a href=&#34;foo.jsp&#34;&#62;Foo &#60;dsp:property bean=&#34;BarFormHandler.baz&#34; paramvalue=&#34;index&#34;/&#62; &#60;/dsp:a&#62; What gets tricky is if you also want a popup window to display the contents of this [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2009/08/31/how-to-set-array-property-in-atg-form/' rel='bookmark' title='How to Set an Array Property in an ATG Form'>How to Set an Array Property in an ATG Form</a></li>
<li><a href='http://betweengo.com/2007/07/20/submitting-an-atg-form-using-a-text-link/' rel='bookmark' title='Submitting an ATG Form Using a Text Link'>Submitting an ATG Form Using a Text Link</a></li>
<li><a href='http://betweengo.com/2009/08/12/atg-currency-converter-not-working-with-jstl-c-set/' rel='bookmark' title='ATG Currency Converter Not Working With JSTL c:set'>ATG Currency Converter Not Working With JSTL c:set</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p align="center"><a href="http://www.flickr.com/photos/bachmont/2808616510/"><img title="la cuarta ventana on Flickr" style="display: block; float: none; margin-left: auto; margin-right: auto" alt="la cuarta ventana on Flickr" src="http://farm4.static.flickr.com/3007/2808616510_51933a7e86.jpg" /></a><a title="la cuarta ventana on Flickr" href="http://www.flickr.com/photos/bachmont/2808616510/">la cuarta ventana</a> by <a title="Flickr: bachmont&#39;s Photostream" href="http://www.flickr.com/photos/bachmont/">bachmont</a>&#160;</p>
<p>Sometimes when you click on a link in an ATG JSP/DSP page you want a property of an ATG component to be set as well.&#160; For example:</p>
<pre>&lt;dsp:a href=&quot;foo.jsp&quot;&gt;Foo
  &lt;dsp:property bean=&quot;BarFormHandler.baz&quot; paramvalue=&quot;index&quot;/&gt;
&lt;/dsp:a&gt;</pre>
<p>What gets tricky is if you also want a popup window to display the contents of this link.</p>
<p><strong>The Wrong Way</strong></p>
<p>I tried adapting the instructions from the tutorial <a title="Popup Windows | open new customised windows with JavaScript" href="http://www.yourhtmlsource.com/javascript/popupwindows.html">Popup Windows | open new customised windows with JavaScript</a>.</p>
<pre>&lt;dsp:a href=&quot;javascript:poptastic('foo.jsp');&quot;&gt;Foo
  &lt;dsp:property bean=&quot;BarFormHandler.baz&quot; paramvalue=&quot;index&quot;/&gt;
&lt;/dsp:a&gt;</pre>
<p>This does not work, i.e. the setter for baz in BarFormHandler is never called.</p>
<p><strong>The Brute Force Way</strong></p>
<p>I then reverted to the original DSP and looked at the outputted HTML.&#160; Based on that I updated the DSP like this.</p>
<pre>&lt;% atg.servlet.DynamoHttpServletRequest dreq = atg.servlet.ServletUtil.getCurrentRequest(); %&gt;
&lt;a href=&quot;javascript:poptastic('foo.jsp?_DARGS=/betweengo/test.jsp_AF&amp;_dynSessConf=&lt;%= dreq.getSessionConfirmationNumber() %&gt;&amp;_D%3A/betweengo/BarFormHandler.baz=+&amp;/betweengo/BarFormHandler.baz=&lt;dsp:valueof param=&quot;index&quot; /&gt;');&quot;&gt;Foo&lt;/a&gt;</pre>
<p>This works but is grotesque.</p>
<p><strong>The Good Idea That Did Not Work</strong></p>
<p>Then I realized I could just set a parameter in the URL and have the form handler use the value to set the property.</p>
<pre>&lt;a href=&quot;javascript:poptastic('foo.jsp?index=&lt;dsp:valueof param=&quot;index&quot; /&gt;');&quot;&gt;Foo&lt;/a&gt;</pre>
<p>And in BarFormHandler</p>
<pre>public boolean beforeSet(DynamoHttpServletRequest req,
            DynamoHttpServletResponse res) throws DropletFormException {

  String indexParam = request.getParameter(&quot;index&quot;);
  setIndex(Integer.parseInt(indexParam));

  return super.beforeSet(request, response);
}</pre>
<p>This did not work plus I did not really like it because now I have a beforeSet method that is called for every single request.</p>
<p><strong>The Winner</strong></p>
<p>I then realized I did not read the tutorial <a title="Popup Windows | open new customised windows with JavaScript" href="http://www.yourhtmlsource.com/javascript/popupwindows.html">Popup Windows | open new customised windows with JavaScript</a> carefully.&#160; There is a more elegant way to call the JavaScript which degrades gracefully for browsers that don’t support JavaScript.</p>
<pre>&lt;dsp:a href=&quot;foo.jsp&quot; onclick=&quot;poptastic(this.href);return false;&quot;&gt;Foo
  &lt;dsp:property bean=&quot;BarFormHandler.baz&quot; paramvalue=&quot;index&quot;/&gt;
&lt;/dsp:a&gt;</pre>
<p>This works, is elegant and requires just adding the onclick attribute to the original DSP.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2010%2F03%2F26%2Fset-atg-property-and-popup-window-after-clicking-on-link%2F&amp;title=Set%20ATG%20Property%20And%20Popup%20Window%20After%20Clicking%20on%20Link" id="wpa2a_4"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2009/08/31/how-to-set-array-property-in-atg-form/' rel='bookmark' title='How to Set an Array Property in an ATG Form'>How to Set an Array Property in an ATG Form</a></li>
<li><a href='http://betweengo.com/2007/07/20/submitting-an-atg-form-using-a-text-link/' rel='bookmark' title='Submitting an ATG Form Using a Text Link'>Submitting an ATG Form Using a Text Link</a></li>
<li><a href='http://betweengo.com/2009/08/12/atg-currency-converter-not-working-with-jstl-c-set/' rel='bookmark' title='ATG Currency Converter Not Working With JSTL c:set'>ATG Currency Converter Not Working With JSTL c:set</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2010/03/26/set-atg-property-and-popup-window-after-clicking-on-link/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ATG Date Tag Converter is Buggy</title>
		<link>http://betweengo.com/2009/11/23/atg-date-tag-converter-is-buggy/</link>
		<comments>http://betweengo.com/2009/11/23/atg-date-tag-converter-is-buggy/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 14:39:17 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Page Development]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[dsp]]></category>
		<category><![CDATA[tag converters]]></category>

		<guid isPermaLink="false">http://betweengo.com/2009/11/23/atg-date-tag-converter-is-buggy/</guid>
		<description><![CDATA[(Photo: Leaf on my car by exfordy) The ATG Date Tag Converter is buggy because Java’s DateFormat is inherently unsafe for multithreaded use.  This is documented in ATG PR #123210 DateTagConverter.convertObjectToString() method is not thread safe. You run into this problem whenever you do something like this. &#60;dsp:valueof param=”creationDate” converter=”date” date=”M/dd/yyyy”/&#62; Unfortunately there is no [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2008/05/28/playing-with-dates-in-java/' rel='bookmark' title='Playing with Dates in Java'>Playing with Dates in Java</a></li>
<li><a href='http://betweengo.com/2009/08/12/atg-currency-converter-not-working-with-jstl-c-set/' rel='bookmark' title='ATG Currency Converter Not Working With JSTL c:set'>ATG Currency Converter Not Working With JSTL c:set</a></li>
<li><a href='http://betweengo.com/2009/09/03/the-strangely-behaved-atg-textarea-tag/' rel='bookmark' title='The Strangely Behaved ATG textarea Tag'>The Strangely Behaved ATG textarea Tag</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><a href="http://www.flickr.com/photos/exfordy/191036192/"><img title="Leaf on my car on Flickr" src="http://farm1.static.flickr.com/60/191036192_6fae11db6c.jpg" alt="Leaf on my car on Flickr" /></a></p>
<p style="text-align: center">(Photo: <a title="Leaf on my car on Flickr" href="http://www.flickr.com/photos/exfordy/191036192/">Leaf on my car</a> by <a title="Flickr: exfordy's photostream" href="http://www.flickr.com/photos/exfordy/">exfordy</a>)</p>
<p>The <a title="Tag Converters - ATG Page Developer's Guide" href="http://www.atg.com/repositories/ContentCatalogRepository_en/manuals/ATG2006.3/pagedev/pagedev0308.html#tagconverters01">ATG Date Tag Converter</a> is buggy because <a title="Playing with Dates in Java - betweenGo" href="http://betweengo.com/2008/05/28/playing-with-dates-in-java/">Java’s DateFormat is inherently unsafe for multithreaded use</a>.  This is documented in <a title="ATG - Customer Care Site - PR #123210 DateTagConverter.convertObjectToString() method is not thread safe" href="https://www.atg.com/esupport/bugs/?FullViewBug=ViewBug&amp;bugId=123210">ATG PR #123210 DateTagConverter.convertObjectToString() method is not thread safe</a>.</p>
<p>You run into this problem whenever you do something like this.</p>
<pre>&lt;dsp:valueof param=”creationDate” converter=”date” date=”M/dd/yyyy”/&gt;</pre>
<p>Unfortunately there is no work around.  If using the Date Tag Converter is not causing problems for you, i.e you don’t see a stack trace like below, then you can ignore this bug.</p>
<pre>2009-04-17 00:19:08,220 ERROR [nucleusNamespace.atg.dynamo.servlet.dafpipeline.DynamoServlet] java.lang.ArrayIndexOutOfBoundsException: 502
  at sun.util.calendar.BaseCalendar.getCalendarDateFromFixedDate(BaseCalendar.java:436)
  at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2081)
  at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:1996)
  at java.util.Calendar.setTimeInMillis(Calendar.java:1071)
  at java.util.Calendar.setTime(Calendar.java:1037)
  at java.text.SimpleDateFormat.format(SimpleDateFormat.java:785)
  at java.text.SimpleDateFormat.format(SimpleDateFormat.java:778)
  at java.text.DateFormat.format(DateFormat.java:314)
  at atg.droplet.DateTagConverter.convertObjectToString(DateTagConverter.java:176)</pre>
<p><img src="https://www.atg.com/images/main-images/clear.gif" alt="" width="1" height="6" />But if you do see a bug like this then you might need to create a custom droplet to format the date.  The droplet should only use DateFormat instances that are not static.  I usually make my DateFormat instances local.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F11%2F23%2Fatg-date-tag-converter-is-buggy%2F&amp;title=ATG%20Date%20Tag%20Converter%20is%20Buggy" id="wpa2a_6"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2008/05/28/playing-with-dates-in-java/' rel='bookmark' title='Playing with Dates in Java'>Playing with Dates in Java</a></li>
<li><a href='http://betweengo.com/2009/08/12/atg-currency-converter-not-working-with-jstl-c-set/' rel='bookmark' title='ATG Currency Converter Not Working With JSTL c:set'>ATG Currency Converter Not Working With JSTL c:set</a></li>
<li><a href='http://betweengo.com/2009/09/03/the-strangely-behaved-atg-textarea-tag/' rel='bookmark' title='The Strangely Behaved ATG textarea Tag'>The Strangely Behaved ATG textarea Tag</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/11/23/atg-date-tag-converter-is-buggy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RQLQueryRange does not sort dates correctly</title>
		<link>http://betweengo.com/2009/11/20/rqlqueryrange-does-not-sort-dates-correctly/</link>
		<comments>http://betweengo.com/2009/11/20/rqlqueryrange-does-not-sort-dates-correctly/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 15:41:37 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Page Development]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[RQLQueryRange]]></category>

		<guid isPermaLink="false">http://betweengo.com/2009/11/20/rqlqueryrange-does-not-sort-dates-correctly/</guid>
		<description><![CDATA[(Photo: Roppongi District Desktop by powerbooktrance) This was bedeviling me for awhile.  I could not figure out why my RQLQueryRange droplet was not sorting by dates correctly.  It turns out this is a known ATG bug which only happens when you are using Oracle, which is 99% of the time. Considering that this bug has [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2008/07/21/targetingrange-ignoring-start-param/' rel='bookmark' title='TargetingRange ignoring start param'>TargetingRange ignoring start param</a></li>
<li><a href='http://betweengo.com/2008/05/28/playing-with-dates-in-java/' rel='bookmark' title='Playing with Dates in Java'>Playing with Dates in Java</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><a href="http://www.flickr.com/photos/powerbooktrance/398220630/"><img title="Roppongi District Desktop on Flickr" src="http://farm1.static.flickr.com/171/398220630_80968f6e43.jpg" alt="Roppongi District Desktop on Flickr" /></a></p>
<p style="text-align: center">(Photo: <a title="Roppongi District Desktop on Flickr" href="http://www.flickr.com/photos/powerbooktrance/398220630/">Roppongi District Desktop</a> by <a title="Flickr: powerbooktrance's photostream" href="http://www.flickr.com/photos/powerbooktrance/">powerbooktrance</a>)</p>
<p>This was bedeviling me for awhile.  I could not figure out why my <a title="ATG RQLQueryRange" href="http://www.atg.com/repositories/ContentCatalogRepository_en/manuals/ATG2006.3/pagedev/pagedev1342.html">RQLQueryRange</a> droplet was not sorting by dates correctly.  It turns out this is a <a title="ATG - Customer Care Site  - PR #130517 RQLQueryRange does not sort dates correctly" href="https://www.atg.com/esupport/bugs/?FullViewBug=ViewBug&amp;bugId=130517">known ATG bug</a> which only happens when you are using Oracle, which is 99% of the time.</p>
<p>Considering that this bug has been open since 2003 one can assume ATG is not interested in fixing it.  This is probably because there is a simple work around.</p>
<blockquote><p>Instead of using the sortProperties parameter, put the the sort directive directly in the RQL statement in the queryRQL parameter.</p>
<pre>&lt;dsp:param name="queryRQL" value="ALL ORDER BY creationDate DESC"/&gt;</pre>
</blockquote>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F11%2F20%2Frqlqueryrange-does-not-sort-dates-correctly%2F&amp;title=RQLQueryRange%20does%20not%20sort%20dates%20correctly" id="wpa2a_8"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2008/07/21/targetingrange-ignoring-start-param/' rel='bookmark' title='TargetingRange ignoring start param'>TargetingRange ignoring start param</a></li>
<li><a href='http://betweengo.com/2008/05/28/playing-with-dates-in-java/' rel='bookmark' title='Playing with Dates in Java'>Playing with Dates in Java</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/11/20/rqlqueryrange-does-not-sort-dates-correctly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Strangely Behaved ATG textarea Tag</title>
		<link>http://betweengo.com/2009/09/03/the-strangely-behaved-atg-textarea-tag/</link>
		<comments>http://betweengo.com/2009/09/03/the-strangely-behaved-atg-textarea-tag/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 16:00:00 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Page Development]]></category>
		<category><![CDATA[ATG]]></category>
		<category><![CDATA[dsp]]></category>

		<guid isPermaLink="false">http://betweengo.com/2009/09/03/the-strangely-behaved-atg-textarea-tag/</guid>
		<description><![CDATA[&#160; (Photo: Escalera al cielo / Stairway to heaven by Davichi) When I create a DSP textarea tag like this it outputs the value of the bean property in the text area box. &#60;dsp:textarea bean=&#34;MyFormHandler.foo&#34; rows=&#34;5&#34; cols=&#34;20&#34;/&#62; Similarly if I create a DSP textarea tag like this I get the same output. &#60;dsp:textarea bean=&#34;MyFormHandler.foo&#34; rows=&#34;5&#34; [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2009/08/31/how-to-set-array-property-in-atg-form/' rel='bookmark' title='How to Set an Array Property in an ATG Form'>How to Set an Array Property in an ATG Form</a></li>
<li><a href='http://betweengo.com/2009/11/23/atg-date-tag-converter-is-buggy/' rel='bookmark' title='ATG Date Tag Converter is Buggy'>ATG Date Tag Converter is Buggy</a></li>
<li><a href='http://betweengo.com/2005/08/08/internet-explorer-form-does-not-invoke-atg-handler/' rel='bookmark' title='Internet Explorer form does not invoke ATG handler'>Internet Explorer form does not invoke ATG handler</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><a href="http://www.flickr.com/photos/davichi/249160641/"><img title="Escalera al cielo / Stairway to heaven on Flickr" alt="Escalera al cielo / Stairway to heaven on Flickr" src="http://farm1.static.flickr.com/95/249160641_ae6e9eca8a.jpg" /></a>&#160; <br />(Photo: <a title="Escalera al cielo / Stairway to heaven on Flickr" href="http://www.flickr.com/photos/davichi/249160641/">Escalera al cielo / Stairway to heaven</a> by <a title="Flickr: Davichi&#39;s Photostream" href="http://www.flickr.com/photos/davichi/">Davichi</a>)</p>
<p>When I create a <a title="(dsp: / dspel:) textarea" href="http://www.atg.com/repositories/ContentCatalogRepository_en/manuals/ATG2006.3/pagedev/pagedev1233.html">DSP textarea</a> tag like this it outputs the value of the bean property in the text area box.</p>
<pre>&lt;dsp:textarea bean=&quot;MyFormHandler.foo&quot; rows=&quot;5&quot; cols=&quot;20&quot;/&gt;</pre>
<p>Similarly if I create a DSP textarea tag like this I get the same output.</p>
<pre>&lt;dsp:textarea bean=&quot;MyFormHandler.foo&quot; rows=&quot;5&quot; cols=&quot;20&quot;&gt;&lt;/dsp:textarea&gt;</pre>
<p><em>However</em> when I leave some space between the textarea opening and closing tag I get a blank instead of the value of the bean property in the text area box.</p>
<pre>&lt;dsp:textarea bean=&quot;MyFormHandler.foo&quot; rows=&quot;5&quot; cols=&quot;20&quot;&gt;
&lt;/dsp:textarea&gt;</pre>
<p><strong>Anyone know why there is a difference?</strong></p>
<p>Anyway after reading the documentation it turns out if I want to control what is output in the text box I can use the default attribute.</p>
<pre>&lt;dsp:textarea bean=&quot;MyFormHandler.foo&quot; rows=&quot;5&quot; cols=&quot;20&quot; default=&quot;bar&quot;/&gt;</pre>
<p>Maybe I should have read the <a title="ATG Page Developer&#39;s Guide" href="http://www.atg.com/repositories/ContentCatalogRepository_en/manuals/ATG2006.3/pagedev/index.html">documentation</a> before writing this post. <img src='http://betweengo.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><strong>Update 2009-09-03:</strong> I also found this strange pattern of behavior with the <a title="(dsp: / dspel:) droplet" href="http://www.atg.com/repositories/ContentCatalogRepository_en/manuals/ATG2006.3/pagedev/pagedev1208.html">DSP droplet</a> tag.&#160; When I invoked a droplet that took no parameters and had no open parameters like this:</p>
<pre>&lt;dsp:droplet name=&quot;MyDroplet&quot;/&gt;</pre>
<p>or like this:</p>
<pre>&lt;dsp:droplet name=&quot;MyDroplet&quot;&gt;&lt;/dsp:droplet&gt;</pre>
<p><strong>the droplet would not be invoked.</strong></p>
<p>However when I did this the droplet was invoked.&#160; Strange …</p>
<pre>&lt;dsp:droplet name=&quot;MyDroplet&quot;&gt;
&lt;/dsp:droplet&gt;</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F09%2F03%2Fthe-strangely-behaved-atg-textarea-tag%2F&amp;title=The%20Strangely%20Behaved%20ATG%20textarea%20Tag" id="wpa2a_10"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2009/08/31/how-to-set-array-property-in-atg-form/' rel='bookmark' title='How to Set an Array Property in an ATG Form'>How to Set an Array Property in an ATG Form</a></li>
<li><a href='http://betweengo.com/2009/11/23/atg-date-tag-converter-is-buggy/' rel='bookmark' title='ATG Date Tag Converter is Buggy'>ATG Date Tag Converter is Buggy</a></li>
<li><a href='http://betweengo.com/2005/08/08/internet-explorer-form-does-not-invoke-atg-handler/' rel='bookmark' title='Internet Explorer form does not invoke ATG handler'>Internet Explorer form does not invoke ATG handler</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/09/03/the-strangely-behaved-atg-textarea-tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Set an Array Property in an ATG Form</title>
		<link>http://betweengo.com/2009/08/31/how-to-set-array-property-in-atg-form/</link>
		<comments>http://betweengo.com/2009/08/31/how-to-set-array-property-in-atg-form/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 17:04:33 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Page Development]]></category>
		<category><![CDATA[ATG]]></category>
		<category><![CDATA[forms]]></category>

		<guid isPermaLink="false">http://betweengo.com/2009/08/31/how-to-set-an-array-property-in-an-atg-form/</guid>
		<description><![CDATA[(Photo: Cool Blue Hive by jurvetson) In the Setting Property Values in Forms section of the ATG Page Developer’s Guide there are two examples for setting values of array properties in forms. Grouped Checkboxes Multiple-Selection List Box Both examples are for a simple form.  But what if you are generating a form using a ForEach [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2009/07/28/how-to-debug-no-output-for-atg-foreach/' rel='bookmark' title='How to Debug No Output for ATG ForEach'>How to Debug No Output for ATG ForEach</a></li>
<li><a href='http://betweengo.com/2008/07/17/jumping-within-page-from-dropdown/' rel='bookmark' title='Jumping to different parts of a page using a dropdown'>Jumping to different parts of a page using a dropdown</a></li>
<li><a href='http://betweengo.com/2010/03/26/set-atg-property-and-popup-window-after-clicking-on-link/' rel='bookmark' title='Set ATG Property And Popup Window After Clicking on Link'>Set ATG Property And Popup Window After Clicking on Link</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><a href="http://www.flickr.com/photos/jurvetson/14520682/"><img title="Cool Blue Hive on Flickr" src="http://farm1.static.flickr.com/14/14520682_4a647400f8.jpg" alt="Cool Blue Hive on Flickr" /></a><br />
(Photo: <a title="Cool Blue Hive on Flickr" href="http://www.flickr.com/photos/jurvetson/14520682/">Cool Blue Hive</a> by <a title="Flickr: jurvetson's Photostream" href="http://www.flickr.com/photos/jurvetson/">jurvetson</a>)</p>
<p>In the <a title="Setting Property Values in Forms" href="http://www.atg.com/repositories/ContentCatalogRepository_en/manuals/ATG2006.3/pagedev/pagedev0704.html">Setting Property Values in Forms</a> section of the <a title="ATG Page Developer’s Guide" href="http://www.atg.com/repositories/ContentCatalogRepository_en/manuals/ATG2006.3/pagedev/index.html">ATG Page Developer’s Guide</a> there are two examples for <a title="Setting Values of Array Properties" href="http://www.atg.com/repositories/ContentCatalogRepository_en/manuals/ATG2006.3/pagedev/pagedev0704.html#settingvaluesofarrayproperties01">setting values of array properties in forms</a>.</p>
<ol>
<li>Grouped Checkboxes</li>
<li>Multiple-Selection List Box</li>
</ol>
<p>Both examples are for a simple form.  But what if you are generating a form using a ForEach droplet and want to set an array property in each iteration of the loop.  Fortunately it turns out to be relatively easy.</p>
<p><strong>Hidden or Text Inputs</strong></p>
<pre>&lt;dsp:droplet name="/atg/dynamo/droplet/ForEach"&gt;
  &lt;dsp:oparam name="output"&gt;
    &lt;dsp:input type="hidden" paramvalue="element.id" bean="MyFormHandler.ids"/&gt;
  &lt;/dsp:oparam&gt;
&lt;/dsp:droplet&gt;</pre>
<p><strong>Select Inputs</strong></p>
<pre>&lt;dsp:droplet name="/atg/dynamo/droplet/ForEach"&gt;
  &lt;dsp:oparam name="output"&gt;
    &lt;dsp:select bean="MyFormHandler.answers"&gt;
     &lt;dsp:option value="foo"&gt;foo&lt;/dsp:option&gt;
     &lt;dsp:option value="bar"&gt;bar&lt;/dsp:option&gt;
    &lt;/dsp:select&gt;
  &lt;/dsp:oparam&gt;
&lt;/dsp:droplet&gt;</pre>
<p>By the way if you try to set the array element directly using the <tt>param:index</tt> notation as in the following example it will not work.</p>
<pre>&lt;dsp:droplet name="/atg/dynamo/droplet/ForEach"&gt;
  &lt;dsp:oparam name="output"&gt;
    &lt;dsp:select bean="MyFormHandler.answers[param:index]"&gt;
     &lt;dsp:option value="foo"&gt;foo&lt;/dsp:option&gt;
     &lt;dsp:option value="bar"&gt;bar&lt;/dsp:option&gt;
    &lt;/dsp:select&gt;
  &lt;/dsp:oparam&gt;
&lt;/dsp:droplet&gt;</pre>
<p>When submitting the above form you will get this exception.</p>
<pre>atg.droplet.DropletException:
  Can't set an element of the array property without a set &lt;name&gt; (int index, Object value) method.</pre>
<p>The exception message is a red herring, there is no way you can set the element of an array property no matter what kind of set method you create.  Trust me, I spent many hours delving into the ATG code to verify this. <img src='http://betweengo.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F08%2F31%2Fhow-to-set-array-property-in-atg-form%2F&amp;title=How%20to%20Set%20an%20Array%20Property%20in%20an%20ATG%20Form" id="wpa2a_12"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2009/07/28/how-to-debug-no-output-for-atg-foreach/' rel='bookmark' title='How to Debug No Output for ATG ForEach'>How to Debug No Output for ATG ForEach</a></li>
<li><a href='http://betweengo.com/2008/07/17/jumping-within-page-from-dropdown/' rel='bookmark' title='Jumping to different parts of a page using a dropdown'>Jumping to different parts of a page using a dropdown</a></li>
<li><a href='http://betweengo.com/2010/03/26/set-atg-property-and-popup-window-after-clicking-on-link/' rel='bookmark' title='Set ATG Property And Popup Window After Clicking on Link'>Set ATG Property And Popup Window After Clicking on Link</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/08/31/how-to-set-array-property-in-atg-form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ATG Currency Converter Not Working With JSTL c:set</title>
		<link>http://betweengo.com/2009/08/12/atg-currency-converter-not-working-with-jstl-c-set/</link>
		<comments>http://betweengo.com/2009/08/12/atg-currency-converter-not-working-with-jstl-c-set/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 18:28:43 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Page Development]]></category>
		<category><![CDATA[dsp]]></category>
		<category><![CDATA[JSTL]]></category>
		<category><![CDATA[tag converters]]></category>

		<guid isPermaLink="false">http://betweengo.com/2009/08/12/atg-currency-converter-not-working-as-expected/</guid>
		<description><![CDATA[This JSP code was not outputting the properly formatted amount. &#60;dspel:valueof value="${dollars}" converter="currency" /&#62; I tried forcing it by specifying the conversion parameters. &#60;dspel:valueof value="${dollars}" converter="currency" locale="en-CA" format="#.00" currency="$" /&#62; I then debugged atg.droplet.CurrencyTagConverter using Eclipse and found this code being executed. public String convertObjectToString(DynamoHttpServletRequest pRequest, Object pValue, Properties pAttributes) throws TagConversionException { if ((pValue [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
<li><a href='http://betweengo.com/2009/07/24/atg-foreach-output-with-separators-between-items/' rel='bookmark' title='ATG ForEach Output with Separators Between Items'>ATG ForEach Output with Separators Between Items</a></li>
<li><a href='http://betweengo.com/2009/11/23/atg-date-tag-converter-is-buggy/' rel='bookmark' title='ATG Date Tag Converter is Buggy'>ATG Date Tag Converter is Buggy</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.flickr.com/photos/unlistedsightings/3230745881/"><img class="aligncenter" title="Currency conversion confusion on Flickr" src="http://farm4.static.flickr.com/3268/3230745881_126be420f3.jpg" alt="Currency conversion confusion on Flickr!" width="500" height="375" /></a></p>
<p>This JSP code was not outputting the properly formatted amount.</p>
<pre>&lt;dspel:valueof value="${dollars}" converter="currency" /&gt;</pre>
<p>I tried forcing it by specifying the conversion parameters.</p>
<pre>&lt;dspel:valueof value="${dollars}" converter="currency" locale="en-CA" format="#.00" currency="$" /&gt;</pre>
<p>I then debugged <a title="CurrencyTagConverter - ATG Java API" href="http://www.atg.com/repositories/ContentCatalogRepository_en/manuals/ATG2006.3/apidoc/atg/droplet/CurrencyTagConverter.html">atg.droplet.CurrencyTagConverter</a> using <a title="Eclipse.org" href="http://eclipse.org/">Eclipse</a> and found this code being executed.</p>
<pre>public String convertObjectToString(DynamoHttpServletRequest pRequest,
                                 Object pValue, Properties pAttributes)
  throws TagConversionException
{
  if ((pValue == null) || (pValue instanceof String))
    return (String)pValue;</pre>
<p>It turns out pValue was a String which is why it was never being formatted.  But why is it a String?</p>
<p>Well the code that sets dollars looks like this.</p>
<pre>&lt;dspel:tomap var="paymentGroup" param="commerceItem.paymentGroups[1]" /&gt;
&lt;c:set var="dollars" value="0" /&gt;
&lt;c:if test="${not empty paymentGroup}"&gt;
  &lt;c:set var="dollars" value="${paymentGroup.amount}" /&gt;
&lt;/c:if&gt;</pre>
<p>Apparently c:set converts the Double to a String.</p>
<p>To work around this problem I did this.</p>
<pre>$&lt;dspel:valueof number="0.00" value="${dollars}" /&gt;</pre>
<p>For further reading please see <a title="Tag Converters" href="http://www.atg.com/repositories/ContentCatalogRepository_en/manuals/ATG2006.3/pagedev/pagedev0308.html">Tag Converters</a> in the <a title="ATG Page Developer’s Guide" href="http://www.atg.com/repositories/ContentCatalogRepository_en/manuals/ATG2006.3/pagedev/index.html">ATG Page Developer’s Guide</a>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F08%2F12%2Fatg-currency-converter-not-working-with-jstl-c-set%2F&amp;title=ATG%20Currency%20Converter%20Not%20Working%20With%20JSTL%20c%3Aset" id="wpa2a_14"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
<li><a href='http://betweengo.com/2009/07/24/atg-foreach-output-with-separators-between-items/' rel='bookmark' title='ATG ForEach Output with Separators Between Items'>ATG ForEach Output with Separators Between Items</a></li>
<li><a href='http://betweengo.com/2009/11/23/atg-date-tag-converter-is-buggy/' rel='bookmark' title='ATG Date Tag Converter is Buggy'>ATG Date Tag Converter is Buggy</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/08/12/atg-currency-converter-not-working-with-jstl-c-set/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Debug No Output for ATG ForEach</title>
		<link>http://betweengo.com/2009/07/28/how-to-debug-no-output-for-atg-foreach/</link>
		<comments>http://betweengo.com/2009/07/28/how-to-debug-no-output-for-atg-foreach/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 11:00:00 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Page Development]]></category>
		<category><![CDATA[ATG]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[dsp]]></category>
		<category><![CDATA[foreach]]></category>

		<guid isPermaLink="false">http://betweengo.com/2009/07/28/no-output-for-atg-foreach/</guid>
		<description><![CDATA[Today I added a feature in my shopping cart JSP page but nothing was showing up.&#160; This was because the output of ATG ForEach droplet was blanks. To debug this I did the following steps. I added an empty oparam to see if the ForEach droplet thought the collection was empty. &#60;dsp:oparam=&#34;empty&#34;&#62;Empty?&#60;/dsp:oparam&#62; It did not. [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2009/07/24/atg-foreach-output-with-separators-between-items/' rel='bookmark' title='ATG ForEach Output with Separators Between Items'>ATG ForEach Output with Separators Between Items</a></li>
<li><a href='http://betweengo.com/2008/04/29/comparison-of-dsp-and-dspel/' rel='bookmark' title='Comparison of DSP and DSPEL'>Comparison of DSP and DSPEL</a></li>
<li><a href='http://betweengo.com/2009/08/31/how-to-set-array-property-in-atg-form/' rel='bookmark' title='How to Set an Array Property in an ATG Form'>How to Set an Array Property in an ATG Form</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/saucef/3514037248/"><img title="foreach" alt="foreach" src="http://farm4.static.flickr.com/3345/3514037248_3cd7dc071e.jpg?v=0" /></a></p>
<p>Today I added a feature in my shopping cart JSP page but nothing was showing up.&#160; This was because the output of <a title="ATG ForEach" href="http://www.atg.com/repositories/ContentCatalogRepository_en/manuals/ATG2006.3/pagedev/pagedev1313.html">ATG ForEach</a> droplet was blanks.</p>
<p>To debug this I did the following steps.</p>
<ol>
<li>I added an empty oparam to see if the ForEach droplet thought the collection was empty.
<pre>&lt;dsp:oparam=&quot;empty&quot;&gt;Empty?&lt;/dsp:oparam&gt;</pre>
<p>It did not. </li>
<li>I outputted the count in the output oparam to see if it was looping through the collection.
<pre>&lt;dsp:oparam=&quot;output&quot;&gt;&lt;dsp:valueof param=&quot;count&quot;/&gt; &lt;dsp:valueof param=&quot;element&quot;/&gt;&lt;/dsp:oparam&gt;</pre>
<p>It was looping through the collection. </li>
<li>Finally I <a title="Debug ATG running on JBoss with Eclipse - betweenGo" href="http://betweengo.com/2009/07/27/debug-atg-running-on-jboss-with-eclipse/">debugged using Eclipse</a> the ForEach code.&#160; The ForEach code can be found in <tt>&lt;ATG&gt;/DAS/src/Java/atg/droplet/ForEach.java</tt>.&#160;
<p>Using the debugger I realized that the element name of the loop was being set to something else which is why <tt>&lt;dsp:valueof param=”element”/&gt;</tt> was blank. </li>
</ol>
<p><font color="#eeeeee">It turned out that the ForEach droplet was inside another ForEach droplet and in that droplet they set the element name like this.</font></p>
<p>&lt;dsp:param name=&quot;elementName&quot; value=&quot;CommerceItem&quot; /&gt;</p>
<p>By setting the <tt>elementName</tt> parameter to something else in my ForEach droplet and then referencing it properly I was finally able to get the expected output.</p>
<pre>&lt;dsp:droplet name=&quot;/atg/dynamo/droplet/ForEach&quot;&gt;
 &lt;dsp:param name=&quot;array&quot; param=&quot;CommerceItem.auxiliaryData.productRef.dvds&quot;/&gt;
 &lt;dsp:param name=&quot;elementName&quot; value=&quot;dvd&quot; /&gt;
 &lt;dsp:oparam name=&quot;output&quot;&gt;
  &lt;dsp:valueof param=&quot;dvd.name&quot; /&gt;
 &lt;/dsp:oparam&gt;
&lt;/dsp:droplet&gt;</pre>
<p>By the way ATG documentation suggests not using <tt>elementName</tt>.</p>
<blockquote><p><code>elementName</code> and <code>indexName</code> allow you to provide a parameter name other than <code>element</code> and <code>index</code>, respectively. A better way to provide a different parameter name is to use the <code>dsp:setvalue</code> tag. </p></blockquote>
<p>In our example we would do this instead of setting the <tt>elementName</tt> param.</p>
<pre> &lt;dsp:setvalue param=&quot;dvd&quot; paramvalue=&quot;element&quot; /&gt;</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F07%2F28%2Fhow-to-debug-no-output-for-atg-foreach%2F&amp;title=How%20to%20Debug%20No%20Output%20for%20ATG%20ForEach" id="wpa2a_16"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2009/07/24/atg-foreach-output-with-separators-between-items/' rel='bookmark' title='ATG ForEach Output with Separators Between Items'>ATG ForEach Output with Separators Between Items</a></li>
<li><a href='http://betweengo.com/2008/04/29/comparison-of-dsp-and-dspel/' rel='bookmark' title='Comparison of DSP and DSPEL'>Comparison of DSP and DSPEL</a></li>
<li><a href='http://betweengo.com/2009/08/31/how-to-set-array-property-in-atg-form/' rel='bookmark' title='How to Set an Array Property in an ATG Form'>How to Set an Array Property in an ATG Form</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/07/28/how-to-debug-no-output-for-atg-foreach/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ATG ForEach Output with Separators Between Items</title>
		<link>http://betweengo.com/2009/07/24/atg-foreach-output-with-separators-between-items/</link>
		<comments>http://betweengo.com/2009/07/24/atg-foreach-output-with-separators-between-items/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 20:52:13 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[Page Development]]></category>
		<category><![CDATA[dsp]]></category>
		<category><![CDATA[foreach]]></category>
		<category><![CDATA[JSTL]]></category>

		<guid isPermaLink="false">http://betweengo.com/2009/07/24/atg-foreach-output-with-separators-between-items/</guid>
		<description><![CDATA[Sometimes you want to list each item in the collection with a separator in between like a comma or slash.  However the trick is to have the separator only in between items. In ATG DSP you can use the ForEach droplet to iterate through each item in a collection.  However to put a separator between [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2009/07/28/how-to-debug-no-output-for-atg-foreach/' rel='bookmark' title='How to Debug No Output for ATG ForEach'>How to Debug No Output for ATG ForEach</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
<li><a href='http://betweengo.com/2008/04/29/comparison-of-dsp-and-dspel/' rel='bookmark' title='Comparison of DSP and DSPEL'>Comparison of DSP and DSPEL</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.flickr.com/photos/karent/25606301/"><img class="aligncenter" title="Pez Collection" src="http://farm1.static.flickr.com/23/25606301_49453ef88a.jpg" alt="Pez Collection" width="375" height="500" /></a></p>
<p>Sometimes you want to list each item in the collection with a separator in between like a comma or slash.  However the trick is to have the separator only in between items.</p>
<p>In ATG DSP you can use the <a title="ForEach" href="http://www.atg.com/repositories/ContentCatalogRepository_en/manuals/ATG2006.3/pagedev/pagedev1313.html">ForEach</a> droplet to iterate through each item in a collection.  However to put a separator between each item is not straight-forward with this droplet.  To do this I used JSTL to test if we are at the end of the collection.  If we are then I don’t add the separator, otherwise I do.</p>
<p>Here is an example.</p>
<pre>&lt;dspel:droplet name="/atg/dynamo/droplet/ForEach"&gt;
 &lt;dspel:param name="array" param="dvds"/&gt;
 &lt;dspel:setvalue param="dvd" paramvalue="element" /&gt;
 &lt;dspel:oparam name="outputStart"&gt;
  &lt;dspel:getvalueof var="size" param="size" /&gt;
 &lt;/dspel:oparam&gt;
 &lt;dspel:oparam name="output"&gt;
  &lt;dspel:valueof param="dvd.title" valueishtml="true"/&gt;
  &lt;dspel:getvalueof var="count" param="count" /&gt;
  &lt;c:if test="${size != count}"&gt; , &lt;/c:if&gt;
 &lt;/dspel:oparam&gt;
&lt;/dspel:droplet&gt;</pre>
<p>And here is the output for this example.</p>
<pre>The Incredibles, Ratatouille, Cars</pre>
<p>Do you have a better or more elegant solution?  Please feel free to let me know in the comments?</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F07%2F24%2Fatg-foreach-output-with-separators-between-items%2F&amp;title=ATG%20ForEach%20Output%20with%20Separators%20Between%20Items" id="wpa2a_18"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2009/07/28/how-to-debug-no-output-for-atg-foreach/' rel='bookmark' title='How to Debug No Output for ATG ForEach'>How to Debug No Output for ATG ForEach</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
<li><a href='http://betweengo.com/2008/04/29/comparison-of-dsp-and-dspel/' rel='bookmark' title='Comparison of DSP and DSPEL'>Comparison of DSP and DSPEL</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/07/24/atg-foreach-output-with-separators-between-items/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Getting the request parameter</title>
		<link>http://betweengo.com/2009/04/10/getting-the-request-parameter/</link>
		<comments>http://betweengo.com/2009/04/10/getting-the-request-parameter/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 18:14:09 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JSTL]]></category>
		<category><![CDATA[Page Development]]></category>
		<category><![CDATA[dsp]]></category>
		<category><![CDATA[JSP]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=687</guid>
		<description><![CDATA[I always forget how to do this so I thought I should write it down. In JSP: &#60;%=request.getParameter("foo")%&#62; &#60;img src="&#60;%=request.getParameter("foo")%&#62;"&#62; In JSTL: &#60;c:out value="${param.foo}"/&#62; In DSP: &#60;dspel:valueof param="foo"/&#62; Related posts: Comparison of DSP and DSPEL Accessing RepositoryItems with JSTL Display formatted HTML text
Related posts:<ol>
<li><a href='http://betweengo.com/2008/04/29/comparison-of-dsp-and-dspel/' rel='bookmark' title='Comparison of DSP and DSPEL'>Comparison of DSP and DSPEL</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
<li><a href='http://betweengo.com/2008/08/12/display-formatted-html/' rel='bookmark' title='Display formatted HTML text'>Display formatted HTML text</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I always forget how to do this so I thought I should write it down.</p>
<p>In JSP:</p>
<pre>&lt;%=request.getParameter("foo")%&gt;
&lt;img src="&lt;%=request.getParameter("foo")%&gt;"&gt;</pre>
<p>In JSTL:</p>
<pre>&lt;c:out value="${param.foo}"/&gt;</pre>
<p>In DSP:</p>
<pre>&lt;dspel:valueof param="foo"/&gt;</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F04%2F10%2Fgetting-the-request-parameter%2F&amp;title=Getting%20the%20request%20parameter" id="wpa2a_20"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2008/04/29/comparison-of-dsp-and-dspel/' rel='bookmark' title='Comparison of DSP and DSPEL'>Comparison of DSP and DSPEL</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
<li><a href='http://betweengo.com/2008/08/12/display-formatted-html/' rel='bookmark' title='Display formatted HTML text'>Display formatted HTML text</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/04/10/getting-the-request-parameter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
