<?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>LogikDevelopment &#187; Bug</title>
	<atom:link href="http://www.logikdev.com/tag/bug/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.logikdev.com</link>
	<description>&#34;Il n&#039;y a pas de problème, il n&#039;y a que des solutions. L&#039;esprit de l&#039;homme invente ensuite le problème.&#34; André Gide</description>
	<lastBuildDate>Fri, 27 Aug 2010 08:54:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>WritableFont doesn&#8217;t like to be static!</title>
		<link>http://www.logikdev.com/2010/01/18/writablefont-doesnt-like-to-be-static/</link>
		<comments>http://www.logikdev.com/2010/01/18/writablefont-doesnt-like-to-be-static/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 18:24:21 +0000</pubDate>
		<dc:creator>smoreau</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[ArrayIndexOutOfBoundsException]]></category>
		<category><![CDATA[Bug]]></category>
		<category><![CDATA[JExcelAPI]]></category>
		<category><![CDATA[JXL]]></category>
		<category><![CDATA[WritableFont]]></category>

		<guid isPermaLink="false">http://www.logikdev.com/?p=265</guid>
		<description><![CDATA[While using the tool JExcelAPI within my Java application to generate Excel spreadsheets, I got the following exception: java.lang.ArrayIndexOutOfBoundsException: 5 at jxl.biff.IndexMapping.getNewIndex(IndexMapping.java:68) at jxl.biff.FormattingRecords.rationalize(FormattingRecords.java:388) at jxl.write.biff.WritableWorkbookImpl.rationalize(WritableWorkbookImpl.java:988) at jxl.write.biff.WritableWorkbookImpl.write(WritableWorkbookImpl.java:692) ... It appears that this exception occurs only when you try to generate more than one Excel spreadsheet! How strange is that! After a bit of investigation, [...]]]></description>
			<content:encoded><![CDATA[<p>While using the tool <a href="http://jexcelapi.sourceforge.net/"><strong>JExcelAPI</strong></a> within my Java application to generate Excel spreadsheets, I got the following exception:</p>
<pre>java.lang.ArrayIndexOutOfBoundsException: 5
	at jxl.biff.IndexMapping.getNewIndex(IndexMapping.java:68)
	at jxl.biff.FormattingRecords.rationalize(FormattingRecords.java:388)
	at jxl.write.biff.WritableWorkbookImpl.rationalize(WritableWorkbookImpl.java:988)
	at jxl.write.biff.WritableWorkbookImpl.write(WritableWorkbookImpl.java:692)
	...</pre>
<p><br/>It appears that this exception occurs only when you try to generate more than one Excel spreadsheet!  How strange is that! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_eek.gif' alt='8-O' class='wp-smiley' /><br />
After a bit of investigation, it seems that the problem comes from the use of the static modifier with a <code>jxl.write.WritableFont</code> variable.</p>
<p>I unfortunately don&#8217;t have the time to check the JExcelAPI code source to understand the root cause.<br />
So my advice would be: &#8220;if you get EXACTLY the same stack trace, simply delete any static modifier you used with the <code>WritableFont</code> variables&#8221;. <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.logikdev.com/2010/01/18/writablefont-doesnt-like-to-be-static/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Onclick event is not fired on IE</title>
		<link>http://www.logikdev.com/2009/12/08/onclick-event-is-not-fired-on-ie/</link>
		<comments>http://www.logikdev.com/2009/12/08/onclick-event-is-not-fired-on-ie/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 23:05:58 +0000</pubDate>
		<dc:creator>smoreau</dc:creator>
				<category><![CDATA[Html]]></category>
		<category><![CDATA[Bug]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[onclick]]></category>
		<category><![CDATA[Return key]]></category>
		<category><![CDATA[RichFaces]]></category>

		<guid isPermaLink="false">http://www.logikdev.com/?p=175</guid>
		<description><![CDATA[I am pretty sure everybody knows that Internet Explorer has &#8220;a few&#8221; bugs&#8230; You didn&#8217;t? Alright, better to stay on your little cloud and leave this blog right away! For the others, I will talk about the JavaScript event onclick which is not fired when the following requirements are matched: In a form; There is [...]]]></description>
			<content:encoded><![CDATA[<p>I am pretty sure everybody knows that Internet Explorer has &#8220;a few&#8221; bugs&#8230;  <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_rolleyes.gif' alt=':roll:' class='wp-smiley' /><br />
You didn&#8217;t? <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_eek.gif' alt='8-O' class='wp-smiley' /> Alright, better to stay on your little cloud and leave this blog right away!</p>
<p>For the others, I will talk about the JavaScript event <strong>onclick</strong> which is not fired when the following requirements are matched:</p>
<ul>
<li>In a form;</li>
<li>There is only ONE input text element;</li>
<li>There is one button which has an <code>onclick</code> event assigned;</li>
<li>You press the &#8216;Enter&#8217; button inside the input text element.</li>
</ul>
<p>For a better understanding, let&#8217;s now take the following example:</p>
<pre class="brush: xml;">
&lt;html&gt;
    &lt;head&gt;&lt;title&gt;Test&lt;/title&gt;&lt;head&gt;
    &lt;body&gt;
        &lt;form&gt;
            &lt;input type=&quot;text&quot; id=&quot;t1&quot;/&gt;
            &lt;input type=&quot;submit&quot; onclick=&quot;alert('onclick fired!'); return true;&quot;/&gt;
        &lt;/form&gt;
    &lt;/body&gt;
&lt;/html&gt;
</pre>
<p>As you can see, there is nothing difficult in this code.<br />
Well, that doesn&#8217;t mean Internet Explorer can handle it&#8230;  <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_lol.gif' alt=':lol:' class='wp-smiley' /> </p>
<p>The bug occurs if you press the &#8216;Enter&#8217; button inside the input text element using Internet Explorer. Indeed, the <code>onclick</code> event is not fired and the text &#8216;onclick fired!&#8217; is not display to the user! However, it works perfectly fine on Firefox and Safari.</p>
<p>The funny thing is this code works on Internet Explorer if you add another input text, even if it is hidden!<br />
Why? Don&#8217;t ask me! <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_neutral.gif' alt=':-|' class='wp-smiley' /> </p>
<p>Anyway, the following example works on IE:</p>
<pre class="brush: xml;">
&lt;html&gt;
    &lt;head&gt;&lt;title&gt;Test&lt;/title&gt;&lt;head&gt;
    &lt;body&gt;
        &lt;form&gt;
            &lt;input type=&quot;text&quot; id=&quot;t1&quot;/&gt;
            &lt;input type=&quot;text&quot; style=&quot;display:none&quot;/&gt;
            &lt;input type=&quot;submit&quot; onclick=&quot;alert('onclick fired!'); return true;&quot;/&gt;
        &lt;/form&gt;
    &lt;/body&gt;
&lt;/html&gt;
</pre>
<p><br/>Why are we assigning an <code>onclick</code> event to the submit button?<br />
It could be for a lot of reasons, but the main one is probably to validate the form before submitting the data.</p>
<p>By the way, RichFaces is very often using this event on the submit buttons.<br />
So remember to add a hidden input text to your form if you want to allow users to use the &#8216;Return&#8217; key. <img src='http://www.logikdev.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.logikdev.com/2009/12/08/onclick-event-is-not-fired-on-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
