<?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>Mersoft Corporation Blog &#187; EXTJS</title>
	<atom:link href="http://blog.mersoft.com/tag/extjs/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mersoft.com</link>
	<description>Achieve, Compete, and Evolve</description>
	<lastBuildDate>Wed, 07 Sep 2011 15:13:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>GWT-EXT 2.0.6 ComboBox &#8211; onChange event</title>
		<link>http://blog.mersoft.com/2010/05/25/gwt-ext-2-0-6-combobox-onchange-event/</link>
		<comments>http://blog.mersoft.com/2010/05/25/gwt-ext-2-0-6-combobox-onchange-event/#comments</comments>
		<pubDate>Tue, 25 May 2010 15:30:54 +0000</pubDate>
		<dc:creator>Tom Bollwitt</dc:creator>
				<category><![CDATA[Java/Java Frameworks]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[EXTJS]]></category>
		<category><![CDATA[google web toolkit]]></category>
		<category><![CDATA[Goolge Web Toolkit]]></category>
		<category><![CDATA[GWT]]></category>
		<category><![CDATA[GWT-EXT]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.mersoft.com/?p=363</guid>
		<description><![CDATA[I ran into an issue where I needed to use the onChange event for a Combobox and it was not working as expected. It only worked when the value was selected from the dropdown. This posed a problem for me since I was not forcing the user to make a selection &#8211; they can enter [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into an issue where I needed to use the onChange event for a Combobox and it was not working as expected. It only worked when the value was selected from the dropdown. This posed a problem for me since I was not forcing the user to make a selection &#8211; they can enter in text manually.</p>
<p>I found <a href="http://www.extjs.com/forum/showthread.php?6343-Solved-1.0.1a-1.1-DateField-change-event-bugs-proposed-fixes&amp;p=52974#post52974" target="_blank">this fix</a> on the EXTJS forum, however the fix did not work when the user entered in their own value into the combo box.</p>
<p>To resolve this I changed 2 lines of code from the fix I found.</p>
<p>I modified&#8230;</p>
<pre>this.startValue = this.getValue();</pre>
<p>to</p>
<pre>this.startValue = this.getRawValue();</pre>
<p>and</p>
<pre>var v = this.getValue();</pre>
<p>to</p>
<pre>var v = this.getRawValue();</pre>
<p>So here is the entire code for the updated fix&#8230;</p>
<pre>Ext.override(Ext.form.Field, {
 onFocus : function() {
 if (!Ext.isOpera) { // don't touch in Opera
 this.el.addClass(this.focusClass);
 }
 if (!this.hasFocus) {
 this.hasFocus = true;
 <span style="color: #0000ff;"><strong>this.startValue = this.getRawValue();</strong></span>
 this.fireEvent("focus", this);
 }
 },

 onBlur : function() {
 this.beforeBlur();
 this.el.removeClass(this.focusClass);
 this.hasFocus = false;
 if (this.validationEvent !== false &amp;&amp; this.validateOnBlur &amp;&amp; this.validationEvent != "blur") {
 this.validate();
 }
 <span style="color: #0000ff;"><strong>var v = this.getRawValue();</strong></span>
 if (String(v) !== String(this.startValue)) {
 this.fireEvent('change', this, v, this.startValue);
 }
 this.fireEvent("blur", this);
 }
 });</pre>
<p>I hope this helps someone out there who may be having the same problem I had.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.mersoft.com%2F2010%2F05%2F25%2Fgwt-ext-2-0-6-combobox-onchange-event%2F&amp;linkname=GWT-EXT%202.0.6%20ComboBox%20%26%238211%3B%20onChange%20event"><img src="http://blog.mersoft.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://blog.mersoft.com/2010/05/25/gwt-ext-2-0-6-combobox-onchange-event/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

