<?xml version="1.0" encoding="ISO-8859-1"?>
<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"
	>

<channel>
	<title>DClick Team Weblog [pt]</title>
	<atom:link href="http://blog.dclick.com.br/feed/pt/" rel="self" type="application/rss+xml" />
	<link>http://blog.dclick.com.br</link>
	<description>Blog do time da DClick</description>
	<pubDate>Wed, 19 Nov 2008 12:37:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>pt</language>
			<item>
		<title>Adobe Max 2008: Google Analytics Tracking For Adobe Flash</title>
		<link>http://blog.dclick.com.br/2008/11/19/adobe-max-2008-google-analytics-tracking-for-adobe-flash/pt/</link>
		<comments>http://blog.dclick.com.br/2008/11/19/adobe-max-2008-google-analytics-tracking-for-adobe-flash/pt/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 11:31:04 +0000</pubDate>
		<dc:creator>Luciano Lobato</dc:creator>
		
		<category><![CDATA[Arquitetura da Informação]]></category>

		<category><![CDATA[RIA]]></category>

		<guid isPermaLink="false">http://blog.dclick.com.br/?p=928</guid>
		<description><![CDATA[Antes, para rastrear o comportamento dos usuários em sites e aplicativos que usam flash e flex, através do Google Analytics, era preciso fazer um monte de ajustes chatos e trabalhosos. Agora, lá na Adobe MAX, disponibilizaram uma library (open source) que facilita bastante:
http://analytics.blogspot.com/2008/11/want-to-track-adobe-flash-now-you-can.html
Abaixo um vídeo que explica melhor:

Documentação
Código para download
]]></description>
			<content:encoded><![CDATA[<p>Antes, para rastrear o comportamento dos usuários em sites e aplicativos que usam flash e flex, através do Google Analytics, era preciso fazer um monte de ajustes chatos e trabalhosos. Agora, lá na Adobe MAX, disponibilizaram uma library (open source) que facilita bastante:</p>
<p><a href="http://analytics.blogspot.com/2008/11/want-to-track-adobe-flash-now-you-can.html">http://analytics.blogspot.com/2008/11/want-to-track-adobe-flash-now-you-can.html</a></p>
<p>Abaixo um vídeo que explica melhor:</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/wXdV4LnF3v8&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/wXdV4LnF3v8&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p><a href="http://code.google.com/apis/analytics/docs/flashTrackingIntro.html">Documentação</a><br />
<a href="http://code.google.com/p/gaforflash/downloads/list">Código para download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dclick.com.br/2008/11/19/adobe-max-2008-google-analytics-tracking-for-adobe-flash/pt/feed/pt/</wfw:commentRss>
		</item>
		<item>
		<title>Adobe Max 2008: Visual Studio, Flex e AMF</title>
		<link>http://blog.dclick.com.br/2008/11/18/adobe-max-2008-visual-studio-flex-e-amf/pt/</link>
		<comments>http://blog.dclick.com.br/2008/11/18/adobe-max-2008-visual-studio-flex-e-amf/pt/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 19:24:34 +0000</pubDate>
		<dc:creator>Rafael Martinelli</dc:creator>
		
		<category><![CDATA[(Sem Categoria)]]></category>

		<guid isPermaLink="false">http://blog.dclick.com.br/?p=926</guid>
		<description><![CDATA[A Adobe está construindo um plugin para desenvolver Flex no VisualStudio, inclusive com Debug. O mais interessante é que foi dito que irão colocar no BlazeDS a funcionalidade de serializar AMF para .NET. Em breve deve estar no labs.
Muito interessante essa iniciativa da Adobe,  mas qual será o real objetivo?
]]></description>
			<content:encoded><![CDATA[<p>A Adobe está construindo um plugin para desenvolver Flex no VisualStudio, inclusive com Debug. O mais interessante é que foi dito que irão colocar no BlazeDS a funcionalidade de serializar AMF para .NET. Em breve deve estar no labs.</p>
<p>Muito interessante essa iniciativa da Adobe,  mas qual será o real objetivo?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dclick.com.br/2008/11/18/adobe-max-2008-visual-studio-flex-e-amf/pt/feed/pt/</wfw:commentRss>
		</item>
		<item>
		<title>Adobe Max 2008: Coldfusion</title>
		<link>http://blog.dclick.com.br/2008/11/18/adobe-max-2008-coldfusion/pt/</link>
		<comments>http://blog.dclick.com.br/2008/11/18/adobe-max-2008-coldfusion/pt/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 19:21:20 +0000</pubDate>
		<dc:creator>Rafael Martinelli</dc:creator>
		
		<category><![CDATA[(Sem Categoria)]]></category>

		<guid isPermaLink="false">http://blog.dclick.com.br/?p=924</guid>
		<description><![CDATA[Para os amantes de CF, a Adobe mostrou sua própria IDE. Não sei se é baseada no CFEclipse, mas mostrou features simples mas que para os que programam em CF sabem o quanto eles sofriam.
A principal delas é introspecção, ou seja, se você instanciar algum .cfc com  a IDE irá lhe mostrar métodos e [...]]]></description>
			<content:encoded><![CDATA[<p>Para os amantes de CF, a Adobe mostrou sua própria IDE. Não sei se é baseada no CFEclipse, mas mostrou features simples mas que para os que programam em CF sabem o quanto eles sofriam.</p>
<p>A principal delas é introspecção, ou seja, se você instanciar algum .cfc com <cfobject> a IDE irá lhe mostrar métodos e propriedades quanto digitar <cfset obj. >. Além disso datasources e outras variáveis do CF são encontradas, start e stop do CF a partir do Eclipse etc.</p>
<p>Ainda não está diponível para download, mas fiquem ligados no labs.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dclick.com.br/2008/11/18/adobe-max-2008-coldfusion/pt/feed/pt/</wfw:commentRss>
		</item>
		<item>
		<title>Adobe Max 2008: FXP</title>
		<link>http://blog.dclick.com.br/2008/11/18/adobe-max-2008-fxp/pt/</link>
		<comments>http://blog.dclick.com.br/2008/11/18/adobe-max-2008-fxp/pt/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 19:04:07 +0000</pubDate>
		<dc:creator>Rafael Martinelli</dc:creator>
		
		<category><![CDATA[(Sem Categoria)]]></category>

		<guid isPermaLink="false">http://blog.dclick.com.br/?p=922</guid>
		<description><![CDATA[O workflow entre o Flash Catalyst e o Flex Builder vai ocorrer através do .fxp. Traduzindo, é como se fosse um projeto &#8220;empacotado&#8221;. Dessa maneira, o Designer pode mandar o .fxp para o Developer  e vice-versa.
Para que os que ficaram desanimados por não terem um mac para testar o Catalyst, estão anunciando a versão [...]]]></description>
			<content:encoded><![CDATA[<p>O workflow entre o Flash Catalyst e o Flex Builder vai ocorrer através do .fxp. Traduzindo, é como se fosse um projeto &#8220;empacotado&#8221;. Dessa maneira, o Designer pode mandar o .fxp para o Developer  e vice-versa.</p>
<p>Para que os que ficaram desanimados por não terem um mac para testar o Catalyst, estão anunciando a versão beta para o 1o trimestre de 2009 para mac e windows. Não está tão longe assim!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dclick.com.br/2008/11/18/adobe-max-2008-fxp/pt/feed/pt/</wfw:commentRss>
		</item>
		<item>
		<title>Adobe Max 2008: Flex Builder Gumbo (Flex 4)</title>
		<link>http://blog.dclick.com.br/2008/11/18/adobe-max-2008-flex-builder-gumbo-flex-4/pt/</link>
		<comments>http://blog.dclick.com.br/2008/11/18/adobe-max-2008-flex-builder-gumbo-flex-4/pt/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 18:56:46 +0000</pubDate>
		<dc:creator>Rafael Martinelli</dc:creator>
		
		<category><![CDATA[MAX 2008]]></category>

		<guid isPermaLink="false">http://blog.dclick.com.br/?p=919</guid>
		<description><![CDATA[Ontem assisti uma palestra do Ctalyst e do Flex 4. O Catalyst todos estão ligados, mas o Flex 4 também me surpreendeu. Seguem algumas das features demonstradas:
Importação de arquivos .fxg;
Ver as diferenças entre um novo arquivo .fxg e o editado pelo desenvolvedor;
Podemos fazer um link para um arquivo Flash, abrir a IDE do Flash direto [...]]]></description>
			<content:encoded><![CDATA[<p>Ontem assisti uma palestra do Ctalyst e do Flex 4. O Catalyst todos estão ligados, mas o Flex 4 também me surpreendeu. Seguem algumas das features demonstradas:</p>
<li>Importação de arquivos .fxg;</li>
<li>Ver as diferenças entre um novo arquivo .fxg e o editado pelo desenvolvedor;</li>
<li>Podemos fazer um link para um arquivo Flash, abrir a IDE do Flash direto do Builder e editar o arquivo Flex. Também podemos ver a animação no Design do Builder;</li>
<li>Service Explorer;</li>
<li>Network Monitor está de volta. Os desbravadores das versões 1.0 e 1.5 sabem o que estou falando;</li>
<li>Package Explorer (como do Java). O detalhe é que ira funcionar com .swc como com .jar;</li>
<li>Criação de templates de .as ,.mxml e .css;</li>
<li>Finalmente move com refactoring;</li>
<li>Mouse Over com AsDoc. Ao colocar o mouse sobre qualquer tag ou as, o AsCode aparece como se fosse um tooltip. Isso também ocorre com nossos próprios comentários. Portanto, comentem!!!!</li>
<li>Geração de gets e sets;</li>
<li>Geração de métodos de eventos, ou seja, ao colocar o evento click em um botão o Builder irá perguntar se você deseja criar um método click padrão no bloco Script;</li>
<li>No debugger  teremos run to line;</li>
<li>Condicional breakpoint;</li>
<li>Essa é uma das melhores: no modo debug, podemos selecionar toda uma expressão e o valor será mostrado como um tooltip (como no Java)</li>
]]></content:encoded>
			<wfw:commentRss>http://blog.dclick.com.br/2008/11/18/adobe-max-2008-flex-builder-gumbo-flex-4/pt/feed/pt/</wfw:commentRss>
		</item>
		<item>
		<title>Arquivos Max: Catalyst, Flex 4 (Gumbo) e Videos</title>
		<link>http://blog.dclick.com.br/2008/11/18/arqivos-max-catalyst-flex-4-gumbo-e-videos/pt/</link>
		<comments>http://blog.dclick.com.br/2008/11/18/arqivos-max-catalyst-flex-4-gumbo-e-videos/pt/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 16:06:08 +0000</pubDate>
		<dc:creator>Rafael Martinelli</dc:creator>
		
		<category><![CDATA[MAX 2008]]></category>

		<guid isPermaLink="false">http://blog.dclick.com.br/?p=911</guid>
		<description><![CDATA[Como prometido, seguem os links dos arquivos da MAX.
Flash Catalyst (somente mac)
Flex 4 (mac)
Flex 4 (win)
Flex 4 Readme (win)
Video Ely Greenfield 1
Video Ely Greenfield 2
]]></description>
			<content:encoded><![CDATA[<p>Como prometido, seguem os links dos arquivos da MAX.</p>
<li><a href="http://blog.dclick.com.br/sources/max/2008/mac/Adobe Flash Catalyst_installer_mac_214930.dmg">Flash Catalyst (somente mac)</a></li>
<li><a href="http://blog.dclick.com.br/sources/max/2008/mac/Gumbo_mac_installer_215018.dmg">Flex 4 (mac)</a></li>
<li><a href="http://blog.dclick.com.br/sources/max/2008/win/Gumbo_win_installer_215018.exe">Flex 4 (win)</a></li>
<li><a href="http://blog.dclick.com.br/sources/max/2008/win/README.txt">Flex 4 Readme (win)</a></li>
<li><a href="http://blog.dclick.com.br/sources/max/2008/videos/ely01.avi">Video Ely Greenfield 1</a></li>
<li><a href="http://blog.dclick.com.br/sources/max/2008/videos/ely02.avi">Video Ely Greenfield 2</a></li>
]]></content:encoded>
			<wfw:commentRss>http://blog.dclick.com.br/2008/11/18/arqivos-max-catalyst-flex-4-gumbo-e-videos/pt/feed/pt/</wfw:commentRss>
<enclosure url="http://blog.dclick.com.br/sources/max/2008/videos/ely01.avi" length="82153388" type="video/x-msvideo" />
<enclosure url="http://blog.dclick.com.br/sources/max/2008/videos/ely02.avi" length="148256304" type="video/x-msvideo" />
		</item>
		<item>
		<title>Flash Catalyst e Flex Builder 4</title>
		<link>http://blog.dclick.com.br/2008/11/17/flex-catalyst-e-flex-builder-4/pt/</link>
		<comments>http://blog.dclick.com.br/2008/11/17/flex-catalyst-e-flex-builder-4/pt/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 00:44:34 +0000</pubDate>
		<dc:creator>Rafael Martinelli</dc:creator>
		
		<category><![CDATA[MAX 2008]]></category>

		<guid isPermaLink="false">http://blog.dclick.com.br/?p=900</guid>
		<description><![CDATA[Pessoal, já estou com o CD do Catalyst e Builder 4. A conexão aqui está muito ruim e devo colocar os arquivos mais tarde.
O Calalyst foi disponibilizado apenas para MAC e o Builder para MAC e Windows.
Junto com os arquivos irei colocar as novidades que vi nesta última palestra sobre as duas ferramentas. O negócio [...]]]></description>
			<content:encoded><![CDATA[<p>Pessoal, já estou com o CD do Catalyst e Builder 4. A conexão aqui está muito ruim e devo colocar os arquivos mais tarde.</p>
<p>O Calalyst foi disponibilizado apenas para MAC e o Builder para MAC e Windows.</p>
<p>Junto com os arquivos irei colocar as novidades que vi nesta última palestra sobre as duas ferramentas. O negócio tá ficando ainda melhor.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dclick.com.br/2008/11/17/flex-catalyst-e-flex-builder-4/pt/feed/pt/</wfw:commentRss>
		</item>
		<item>
		<title>Looking ahead to next version of Flex</title>
		<link>http://blog.dclick.com.br/2008/11/17/looking-ahead-to-next-version-of-flex/pt/</link>
		<comments>http://blog.dclick.com.br/2008/11/17/looking-ahead-to-next-version-of-flex/pt/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 00:41:32 +0000</pubDate>
		<dc:creator>Rafael Martinelli</dc:creator>
		
		<category><![CDATA[MAX 2008]]></category>

		<guid isPermaLink="false">http://blog.dclick.com.br/?p=894</guid>
		<description><![CDATA[Como sempre, Ely Greenfield fez uma ótima palestra. Para quem não sabe, Ely é o engenheiro chefe do SDK e está trabalhando no SDK do Flex 4, que engloba suporte para o Thermo (Flash Catalyst).
O projeto já está disponível com o codenome Gumbo. O próprio Ely disse que o projeto possui diversos bugs, mas que [...]]]></description>
			<content:encoded><![CDATA[<p>Como sempre, Ely Greenfield fez uma ótima palestra. Para quem não sabe, Ely é o engenheiro chefe do SDK e está trabalhando no SDK do Flex 4, que engloba suporte para o Thermo (Flash Catalyst).</p>
<p>O projeto já está disponível com o codenome <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4">Gumbo</a>. O próprio Ely disse que o projeto possui diversos bugs, mas que já podemos ver como irá funcionar a próxima versão.</p>
<p>Muitos pontos interessantes foram colocados, como a separação total entre Designers e Desenvolvedores que o Catalyst irá proporcionar e como isso vai funcionar em termos de código. Nos exemplos pudemos ver um novo namespace e toda uma nova linha se componentes chamada FxComponents. Novos metas também foram mostrados como [SkinPart] e [SkinStates]. Não vale a pena explicar todas essas novidades no detalhe, pois muita coisa ainda vai mudar. Vale sim a pena mencionar um novo formato que o After Effects, Illustrator, Fireworks e Photoshop irão exportar, o .fxg. Essa extensão nada mais é que a tradução de um vertor/imagem/skin em mxml.</p>
<p>Também foi mostrada a nova sintaxe de States:</p>
<div class="igBar"><span id="lcode-2"><a href="#" onclick="javascript:showPlainTxt('code-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-2">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;FxButton label=<span style="color:#CC0000;">"DClick"</span> label.<span style="">stateX</span>=<span style="color:#CC0000;">"Flex"</span> /&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Como vocês podem ver, no estado "stateX" o label terá o nome de Flex.</p>
<p>Pudemos ver alguns exemplos de novas propriedades e também como o novo SDK explora o Player 10 =, usando X, Y, Z. Irei colocar em outro post dois vídeos com pedaços da apresentação. A qualidade não está muito boa, mas vale a pena ver pelas animações. Tudo, absolutamente tudo que você podem ver, foi feito com MXML.</p>
<p>Quanto a compatibilidade, essa é a primeira premissa. Poderemos ter, nas mesmas aplicações, pedaços em Flex 3 e Flex 4 e o compilador se encarregara do trabalho. Existirão algumas limitações como no caso de States. Se usarmos a nova sintaxe, não poderemos fazer isso em um arquivo antigo. Mas poderemos ter arquivos com ambas as sintaxes dos states na mesma aplicação em arquivos diferentes. Acredito que é cedo para falarmos nisso, mas é importante sabermos da preocupação da Adobe.</p>
<p>Por fim, também estão trabalhando na velocidade do compilador, chegando a um ganho de até 5x em aplicações realmente grandes.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dclick.com.br/2008/11/17/looking-ahead-to-next-version-of-flex/pt/feed/pt/</wfw:commentRss>
		</item>
		<item>
		<title>Max 2008 - General Session #1.1</title>
		<link>http://blog.dclick.com.br/2008/11/17/max-2008-general-session-11/pt/</link>
		<comments>http://blog.dclick.com.br/2008/11/17/max-2008-general-session-11/pt/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 21:55:07 +0000</pubDate>
		<dc:creator>Rafael Martinelli</dc:creator>
		
		<category><![CDATA[(Sem Categoria)]]></category>

		<category><![CDATA[MAX 2008]]></category>

		<guid isPermaLink="false">http://blog.dclick.com.br/?p=879</guid>
		<description><![CDATA[Mais uma novidade anunciada por Kevin Lynch (parente do Harry Poter) é o Air 1.5 com suporte a WebKit + SquirrelFish e com as novas features do Flash Player 10. A versão para Linux deve estar disponível em algumas semanas também. E as versões para MAC e Windows já estão disponíveis (ele não disse onde).
Nas [...]]]></description>
			<content:encoded><![CDATA[<p>Mais uma novidade anunciada por Kevin Lynch (parente do Harry Poter) é o Air 1.5 com suporte a WebKit + SquirrelFish e com as novas features do Flash Player 10. A versão para Linux deve estar disponível em algumas semanas também. E as versões para MAC e Windows já estão disponíveis (ele não disse onde).</p>
<p>Nas apresentações estamos vendo diversas features do Player 10, mas o que mais me impressionou foram as novas features de texto renderização em tempo de execução. Particularmente não li sobre essas features, mas fiquei curioso para conhecer depois de ver as demos.</p>
<p>Kevin Lynch também mostrou um dispositivo (um pouco maior que um celular) com Linux e Air 1.5 instalado. Todas as aplicações mostradas rodaram, mostrando o conceito Cliente+Cloud, além do Air rodando em Linux.</p>
<p>Outra aplicação bem interessante foi <a href="http://flex.org/tour">Tour de Flex</a>. É uma aplicação em air com vários exemplos de aplicações (mais de 200), integrações, com código fonte e demos. Muito bom.</p>
<p>Adobe Cocomo (Building Realtime Social Applications in Flex). O nome já diz tudo. A Adobe irá prover toda a infra-estrutura para usarmos Real Time Data Messaging, áudio, vídeo etc. Ou seja, as features do Data Services. Já está disponível em beta no labs.</p>
<p>Adobe Wave (Displaying a desktop notification is a simple as sending a email). Parece uma espécie de RSS com notificação.  O exemplo era colocar um convite para uma festa e receber as respostas no Desktop. Ainda não sei o objetivo da Adobe com isso. Quem sabe?</p>
<p>Flash Full no celular. Ficou claro que a Adobe vai voltar os esforços da área de mobile para colocar o Flash Player Full nos celulares. Foi mostrado alguns celulares da Nokia (N95), Sansung, telefone do Google etc, funcionando com aplicações como YouTube (vídeo) e Last.fm (áudio). Sobre o IPhone foi dito que estão trabalhando, mas não foi mostrado. Todo esse esforço deve-se ao fato do grande crescimento dos dispositivos móveis no acesso a Internet, superando desktops e notebooks.</p>
<p>Maria Shriver (primeira dama da Califórnia - ela mesmo, esposa do Terminator) esteve falando sobre o projeto que ela dirige: <a href="http://www.californiamuseum.org/trails/">California Legacy Trails</a>. O projeto parece ser interessante. Na verdade não tenho muito o que falar, achei a presença ilustre.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dclick.com.br/2008/11/17/max-2008-general-session-11/pt/feed/pt/</wfw:commentRss>
		</item>
		<item>
		<title>Buscando registros usando Like com E4X ou FilterFunction, faça sua escolha.</title>
		<link>http://blog.dclick.com.br/2008/11/17/buscando-registros-usando-like-com-e4x-ou-filterfunction-faca-sua-escolha/pt/</link>
		<comments>http://blog.dclick.com.br/2008/11/17/buscando-registros-usando-like-com-e4x-ou-filterfunction-faca-sua-escolha/pt/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 18:43:30 +0000</pubDate>
		<dc:creator>Marcus Nadai</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[e4x]]></category>

		<category><![CDATA[filterfunction]]></category>

		<category><![CDATA[filtro]]></category>

		<category><![CDATA[like]]></category>

		<category><![CDATA[sql]]></category>

		<category><![CDATA[xmllist]]></category>

		<guid isPermaLink="false">http://blog.dclick.com.br/?p=835</guid>
		<description><![CDATA[Semana passada tive que fazer um filtro em um datagrid que tinha como dataprovider um xml.
O filtro seria parecido com o like das queries SQL de consulta ao banco de dados. Fazendo a minha busca, encontrei duas opções para concluir essa tarefa: O filterFunction do XmlListCollection e o search do e4x.
As duas implementações são simples [...]]]></description>
			<content:encoded><![CDATA[<p>Semana passada tive que fazer um filtro em um datagrid que tinha como dataprovider um xml.</p>
<p>O filtro seria parecido com o like das queries SQL de consulta ao banco de dados. Fazendo a minha busca, encontrei duas opções para concluir essa tarefa: O filterFunction do XmlListCollection e o search do e4x.</p>
<p>As duas implementações são simples e interessantes. Falta testar o desempenho(deixo com vcs...hehehe)</p>
<p>Segue a aplicação implementando as duas soluções:</p>

<object	type="application/x-shockwave-flash"
			data="/sources/filtros/Filtro.swf"
			width="590"
			height="500">
	<param name="movie" value="/sources/filtros/Filtro.swf" />
</object>
<p>Seguem os fontes:</p>
<div class="igBar"><span id="lxml-5"><a href="#" onclick="javascript:showPlainTxt('xml-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-5">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"utf-8"</span>?<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx</span>:Application xmlns:<span style="color: #000066;">mx</span>=<span style="color: #ff0000;">"http://www.adobe.com/2006/mxml"</span> <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">"vertical"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066;">verticalAlign</span>=<span style="color: #ff0000;">"middle"</span> <span style="color: #000066;">backgroundColor</span>=<span style="color: #ff0000;">"white"</span> <span style="color: #000066;">verticalGap</span>=<span style="color: #ff0000;">"20"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx</span>:Script<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;![CDATA[</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; private function filterFunc(item:Object):Boolean </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return item.text().toUpperCase().indexOf(stateName.text.toUpperCase())&gt; -1;&nbsp;&nbsp;&nbsp;&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;private function filtrar():void</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;{</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;xmlListE4x.source = dp.country.state.(*.toUpperCase().search(stateName0.text.toUpperCase())&gt; -1);</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ]]&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx</span>:Script<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx</span>:XML <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"dp"</span> <span style="color: #000066;">source</span>=<span style="color: #ff0000;">"countries_states.xml"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx</span>:XMLListCollection <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"xmlListFilterFunc"</span> <span style="color: #000066;">source</span>=<span style="color: #ff0000;">"{dp.country.state}"</span> <span style="color: #000066;">filterFunction</span>=<span style="color: #ff0000;">"filterFunc"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx</span>:XMLListCollection <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"xmlListE4x"</span> <span style="color: #000066;">source</span>=<span style="color: #ff0000;">"{dp.country.state}"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx</span>:Panel <span style="color: #000066;">width</span>=<span style="color: #ff0000;">"322"</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">"248"</span> <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">"absolute"</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">"Filtro usando Filer Function"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx</span>:Label <span style="color: #000066;">text</span>=<span style="color: #ff0000;">"Name:"</span>&nbsp; <span style="color: #000066;">x</span>=<span style="color: #ff0000;">"10"</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">"10"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx</span>:TextInput <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"stateName"</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">"232"</span> <span style="color: #000066;">change</span>=<span style="color: #ff0000;">"xmlListFilterFunc.refresh()"</span>&nbsp; <span style="color: #000066;">x</span>=<span style="color: #ff0000;">"60"</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">"10"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx</span>:DataGrid <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"dataGrid"</span> <span style="color: #000066;">dataProvider</span>=<span style="color: #ff0000;">"{xmlListFilterFunc}"</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">"10"</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">"38"</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">"282"</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">"140"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx</span>:columns<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx</span>:DataGridColumn <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"codeCol"</span> <span style="color: #000066;">dataField</span>=<span style="color: #ff0000;">"@code"</span> <span style="color: #000066;">headerText</span>=<span style="color: #ff0000;">"Abbr:"</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">"60"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx</span>:DataGridColumn <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"nameCol"</span> <span style="color: #000066;">dataField</span>=<span style="color: #ff0000;">"*"</span> <span style="color: #000066;">headerText</span>=<span style="color: #ff0000;">"Name:"</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">"240"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx</span>:columns<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx</span>:DataGrid<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx</span>:Label <span style="color: #000066;">text</span>=<span style="color: #ff0000;">"Filtered: Showing {xmlListFilterFunc.length} record(s)"</span> <span style="color: #000066;">visible</span>=<span style="color: #ff0000;">"{stateName.text.length&gt;</span> 0}&quot; x=&quot;10&quot; y=&quot;186&quot;/&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;">&lt;/mx:Panel&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;">&lt;mx:Panel width="</span>322<span style="color: #ff0000;">" height="</span>248<span style="color: #ff0000;">" layout="</span>absolute<span style="color: #ff0000;">" title="</span>Filtro usando Search do E4x<span style="color: #ff0000;">"&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;mx:Label text="</span>Name:<span style="color: #ff0000;">"&nbsp; x="</span>10<span style="color: #ff0000;">" y="</span>10<span style="color: #ff0000;">"/&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;mx:TextInput id="</span>stateName0<span style="color: #ff0000;">" width="</span>232<span style="color: #ff0000;">" change="</span>filtrar<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #ff0000;">"&nbsp; x="</span>60<span style="color: #ff0000;">" y="</span>10<span style="color: #ff0000;">"/&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;mx:DataGrid id="</span>dataGrid0<span style="color: #ff0000;">" dataProvider="</span><span style="color: #66cc66;">&#123;</span>xmlListE4x<span style="color: #66cc66;">&#125;</span><span style="color: #ff0000;">" x="</span>10<span style="color: #ff0000;">" y="</span>38<span style="color: #ff0000;">" width="</span>282<span style="color: #ff0000;">" height="</span>140<span style="color: #ff0000;">"&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;mx:columns&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;mx:DataGridColumn id="</span>codeCol0<span style="color: #ff0000;">" dataField="</span>@code<span style="color: #ff0000;">" headerText="</span>Abbr:<span style="color: #ff0000;">" width="</span>60<span style="color: #ff0000;">" /&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;mx:DataGridColumn id="</span>nameCol0<span style="color: #ff0000;">" dataField="</span>*<span style="color: #ff0000;">" headerText="</span>Name:<span style="color: #ff0000;">" width="</span>240<span style="color: #ff0000;">" /&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/mx:columns&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/mx:DataGrid&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;mx:Label text="</span>Filtered: Showing <span style="color: #66cc66;">&#123;</span>xmlListE4x.length<span style="color: #66cc66;">&#125;</span> record<span style="color: #66cc66;">&#40;</span>s<span style="color: #66cc66;">&#41;</span><span style="color: #ff0000;">" visible="</span><span style="color: #66cc66;">&#123;</span>stateName0.text.length<span style="font-weight: bold; color: black;">&gt;</span></span> 0}&quot; x=&quot;10&quot; y=&quot;186&quot;/&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx</span>:Panel<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx</span>:Application<span style="font-weight: bold; color: black;">&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>O XML usado no dataProvider:</p>
<div class="igBar"><span id="lxml-6"><a href="#" onclick="javascript:showPlainTxt('xml-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-6">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"utf-8"</span>?<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;countries<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Taken from: http://canadaonline.about.com/library/bl/blpabb.htm --&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;country</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"Canada"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"AB"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Alberta<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"BC"</span><span style="font-weight: bold; color: black;">&gt;</span></span>British Columbia<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"MB"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Manitoba<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"NB"</span><span style="font-weight: bold; color: black;">&gt;</span></span>New Brunswick<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"NL"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Newfoundland and Labrador<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"NT"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Northwest Territories<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"NS"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Nova Scotia<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"NU"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Nunavut<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"ON"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Ontario<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"PE"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Prince Edward Island<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"QC"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Quebec<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"SK"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Saskatchewan<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"YT"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Yukon Territory<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/country<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Taken from: http://www.usps.com/ncsc/lookups/usps_abbreviations.html --&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;country</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"United States of America"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"AL"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Alabama<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"AK"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Alaska<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"AS"</span><span style="font-weight: bold; color: black;">&gt;</span></span>American Samoa<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"AZ"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Arizona<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"AR"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Arkansas<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"CA"</span><span style="font-weight: bold; color: black;">&gt;</span></span>California<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"CO"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Colorado<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"CT"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Connecticut<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"DE"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Delaware<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"DC"</span><span style="font-weight: bold; color: black;">&gt;</span></span>District of Columbia<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"FM"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Federated States of Micronesia<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"FL"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Florida<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"GA"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Georgia<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"GU"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Guam<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"HI"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Hawaii<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"ID"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Idaho<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"IL"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Illinois<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"IN"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Indiana<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"IA"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Iowa<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"KS"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Kansas<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"KY"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Kentucky<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"LA"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Louisiana<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"ME"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Maine<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"MH"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Marshall Islands<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"MD"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Maryland<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"MA"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Massachusetts<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"MI"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Michigan<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"MN"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Minnesota<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"MS"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Mississippi<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"MO"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Missouri<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"MT"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Montana<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"NE"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Nebraska<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"NV"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Nevada<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"MP"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Northern Mariana Islands<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"NC"</span><span style="font-weight: bold; color: black;">&gt;</span></span>North Carolina<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"ND"</span><span style="font-weight: bold; color: black;">&gt;</span></span>North Dakota<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"NH"</span><span style="font-weight: bold; color: black;">&gt;</span></span>New Hampshire<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"NJ"</span><span style="font-weight: bold; color: black;">&gt;</span></span>New Jersey<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"NM"</span><span style="font-weight: bold; color: black;">&gt;</span></span>New Mexico<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"NY"</span><span style="font-weight: bold; color: black;">&gt;</span></span>New York<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"OH"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Ohio<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"OK"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Oklahoma<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"OR"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Oregon<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"PW"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Palau<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"PA"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Pennsylvania<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"PR"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Puerto Rico<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"RI"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Rhode Island<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"SC"</span><span style="font-weight: bold; color: black;">&gt;</span></span>South Carolina<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"SD"</span><span style="font-weight: bold; color: black;">&gt;</span></span>South Dakota<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"TN"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Tennessee<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"TX"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Texas<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"UT"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Utah<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"VA"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Virginia<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"VI"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Virgin Islands<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"VT"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Vermont<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"WA"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Washington<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"WI"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Wisconsin<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"WV"</span><span style="font-weight: bold; color: black;">&gt;</span></span>West Virginia<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;state</span> <span style="color: #000066;">code</span>=<span style="color: #ff0000;">"WY"</span><span style="font-weight: bold; color: black;">&gt;</span></span>Wyoming<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/state<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/country<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/countries<span style="font-weight: bold; color: black;">&gt;</span></span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Em ambos os casos terá como resultado uma consulta semelhante ao like %...% do SQL.</p>
<p>No primeiro dataGrid é feito o filtro baseado no filterFunction, ao preencher o campo de texto é disparada a função <em>filterFunc(item:Object):Boolean</em> por meio do método <em>xmlListFilterFunc.refresh()</em>, retornando true somente para as linhas do xml que satisfazem a consulta. Ou seja, <em>indexOf(..) > -1</em>.</p>
<p>No segundo dataGrid é pelo E4X que fazemos a consulta. Para cada linha do xml é comparada com o texto digitado no campo. O <em>search</em> funciona igual à função indexOf da classe String. O intessante a observar neste segundo exemplo é que qualquer consulta feita por meio do texto do xml, ou seja, se vc tem como nó do xml &lt;state code="AB"&gt;<em>Alberta</em>&lt;/state&gt;  o texto é <em>Alberta</em>. Isso é representado no E4X por <strong>(*)</strong>.</p>
<p>Qualquer dúvida será bem vinda.</p>
<p>Abraços</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dclick.com.br/2008/11/17/buscando-registros-usando-like-com-e4x-ou-filterfunction-faca-sua-escolha/pt/feed/pt/</wfw:commentRss>
		</item>
		<item>
		<title>Max 2008 - General Session #1</title>
		<link>http://blog.dclick.com.br/2008/11/17/max-2008-general-session-1/pt/</link>
		<comments>http://blog.dclick.com.br/2008/11/17/max-2008-general-session-1/pt/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 17:53:46 +0000</pubDate>
		<dc:creator>Rafael Martinelli</dc:creator>
		
		<category><![CDATA[(Sem Categoria)]]></category>

		<category><![CDATA[MAX 2008]]></category>

		<guid isPermaLink="false">http://blog.dclick.com.br/?p=877</guid>
		<description><![CDATA[Acbamos de ver um pedaço da 1a general session com o Predidente da Abode Shantanu Narayen. O que ele acaba de anunciar que o Thermo vai se chamar Flash Catalist (acredito que alguns já sabiam) e que teremos uma versão disponível para quem estará na MAX. Assim que tiver a cópia disponibilizo para download.
A Internet [...]]]></description>
			<content:encoded><![CDATA[<p>Acbamos de ver um pedaço da 1a general session com o Predidente da Abode Shantanu Narayen. O que ele acaba de anunciar que o Thermo vai se chamar Flash Catalist (acredito que alguns já sabiam) e que teremos uma versão disponível para quem estará na MAX. Assim que tiver a cópia disponibilizo para download.</p>
<p>A Internet ainda não está muito boa no evento, mas assim que puder disponibilizo. Não esqueçam que estamos com 6h a menos.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dclick.com.br/2008/11/17/max-2008-general-session-1/pt/feed/pt/</wfw:commentRss>
		</item>
		<item>
		<title>Refatorando o ModelLocator do Cairngorm - Parte I</title>
		<link>http://blog.dclick.com.br/2008/11/16/refatorando-o-modellocator-do-cairngorm-parte-i/pt/</link>
		<comments>http://blog.dclick.com.br/2008/11/16/refatorando-o-modellocator-do-cairngorm-parte-i/pt/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 01:14:20 +0000</pubDate>
		<dc:creator>Pablo Souza</dc:creator>
		
		<category><![CDATA[Cairngorm &amp; Patterns]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[ProgramaÃ§Ã£o]]></category>

		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blog.dclick.com.br/?p=837</guid>
		<description><![CDATA[Recentemente, estou em contato com um projeto que utiliza a micro-arquitetura Cairngorm e o padrão ModelLocator de uma forma bem responsável. Isso me motivou a escrever esse post e reconsiderar a necessidade do uso do padrão ModelLocator em minhas aplicações Cairngorm, ou pelo menos ter muito mais cuidado ao utilizá-lo.
 
Geralmente, o que encontramos são [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: 8pt; font-family: Verdana;">Recentemente, estou em contato com um projeto que utiliza a micro-arquitetura <em>Cairngorm</em> e o padrão <em>ModelLocator</em> de uma forma bem responsável. Isso me motivou a escrever esse post e reconsiderar a necessidade do uso do padrão <em>ModelLocator</em> em minhas aplicações <em>Cairngorm</em>, ou pelo menos ter muito mais cuidado ao utilizá-lo.</span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;"> </span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;">Geralmente, o que encontramos são implementações monolíticas do <em>ModelLocator</em> no <em>Cairngorm</em>, com centenas de linhas de código para armazenar estados da aplicação, na tentativa insana de centralizar o modelo de dados da aplicação num ponto único, de fácil acesso. Confesso que isso sempre me incomodou, uma vez que torna o <em>ModelLocator</em> um anti-pattern, um repositório de variáveis globais e scripts procedurais (digo, <em>Commands</em> .... rs). </span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;"> </span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;">O <em>binding</em> para variáveis globais torna os componentes menos reutilizáveis, dificultando os testes, a substituição do modelo, a modificações das views da aplicação, a divisão de responsabilidade, promovendo assim um forte acoplamento entre as partes, justamente o oposto do que um design pattern deveria fazer: promover reutilização de código, programação orientada à interface, baixo acoplamento, divisão de responsabilidade, etc. </span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;"> </span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;">Além do mais, o nome “<em>ModelLocator</em>” sugere que os objetos desse tipo serão utilizados para alocar modelos, ainda mais pelo fato dele implementar o padrão <em>Service Locator</em>. Mas não, no <em>Cairngorm</em> o que encontramos é um <em>Model Locator</em> que na verdade é o próprio modelo.</span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;"> </span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;">Outro fato que me incomoda bastante, é o da implementação do <em>ModelLocator</em> no <em>Cairngorm</em> ser vendido como um exemplo do padrão <em>Singleton</em>, uma vez que na verdade é mais um exemplo do padrão <em>Monostate</em>, que pode ser descrito como uma classe com membros estáticos, de forma que todas as instâncias dessa classe compartilham a mesma informação.</span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;"> </span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;">Bom, tudo bem, mas agora você deve estar se perguntando: “Como posso resolver esse problema?”. Resposta: <em>Domain Models</em>, <em>Presentation Models</em> e Injeção de Dependência.</span></p>
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;"> </span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;">Com o uso do padrão <em>Domain Model</em>, podemos atribuir à ele a tarefa de estruturar os dados da nossa aplicação e definir seus comportamentos (lógica de dados), retirando assim essa responsabilidade do <em>ModelLocator</em>. Aqui cabe uma discussão com relação à distribuição de responsabilidades, uma vez que muitos irão consider mais adequado (e talvez o seja mesmo) manter a definição de comportamentos nos Commands.</span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;">Um dos papéis do padrão <em>Presentation Model</em> é o de separar a <em>view</em> do <em>model</em>, adicionando um objeto mediador entre eles, tornando tanto a view quanto o modelo substituíveis, isso é, desacoplados. Isso faz com que tudo que a <em>view</em> precise, tanto dados quanto métodos, esteja presente nesse objeto presentation model.</span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;">Com a injeção de dependência, o componente não é mais responsável por recuperar uma instância do modelo, ao invés disso a responsabilidade é repassada a outro componente que deseja utilizá-lo.</span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;"> </span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;">Por exemplo, ao invés de:</span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;"> </span></p>
<div class="igBar"><span id="lactionscript-9"><a href="#" onclick="javascript:showPlainTxt('actionscript-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-9">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> model : ShopModelLocator = ShopModelLocator.<span style="color: #006600;">getInstance</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;">Teríamos:</span></p>
<div class="igBar"><span id="lactionscript-10"><a href="#" onclick="javascript:showPlainTxt('actionscript-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-10">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> model : ShopModelLocator; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;"> </span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;">Isso nos leva a crer que não exista a necessidade do <em>ModelLocator</em> ser um <em>Singleton</em>, mas sim uma interface (talvez com um nome menos confuso...), de forma que não importe qual será sua implementação. Podem assim existir implementações diferentes para desenvolvimento, teste e produção. </span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;"> </span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;">Essa arquitetura faz com que o <em>ModelLocator</em> deixe de ser usado como um repositório de dados, e passe finalmente a ser usado como um repositório de modelos, um local onde poderemos encontrar objetos que armazenam dados, através dos <em>Domain Models</em> e <em>Presentation Models</em>. </span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;"> </span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;">Steven Webster vem defendendo junto a <em>Adobe Consulting</em> a incorporação do padrão <em>Presentation Model</em> (também conhecido como <em>Application Model</em>) no <em>Cairngorm</em>, uma vez que ele diz estar utilizando esse padrão em seus projetos de grande escala. Embora haja essa “preferência” de Webster, aparentemente a versão 3.0 do <em>Cairngorm</em> ainda não irá adotá-lo.</span></p>
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;">No próximo post vamos desenvolver uma aplicação Flex utilizando framework Cairngorm, da forma como estamos acostumados a ver. Depois vamos refatorá-la para aplicar os padrões que apresentei a vocês.</span></p>
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;">Até a próxima, e fiquem a vontade para perguntar!</span></p>
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal"><strong><span style="font-size: 8pt; font-family: Verdana;">Referências:</span></strong></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;"> </span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;">Steven Webster comenta sobre a adoção do padrão <em>Presentation Model</em> no <em>Cairngorm 3.0</em>:<br />
<a href="http://www.adobeforums.com/webx/.59b654d0">http://www.adobeforums.com/webx/.59b654d0</a></span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;"> </span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;">Martin Fowler explicando o padrão <em>Presentation Model</em>:<br />
<a href="http://martinfowler.com/eaaDev/PresentationModel.html">http://martinfowler.com/eaaDev/PresentationModel.html</a></span></p>
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Verdana;"> </span></p>
<p><span style="font-size: 8pt; font-family: Verdana;">Paul Williams explicando o padrão <em>Presentation Model:<br />
</em><a href="http://weblogs.macromedia.com/paulw/archives/2007/09/presentation_pa.html">http://weblogs.macromedia.com/paulw/archives/2007/09/presentation_pa.html</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dclick.com.br/2008/11/16/refatorando-o-modellocator-do-cairngorm-parte-i/pt/feed/pt/</wfw:commentRss>
		</item>
		<item>
		<title>Adobe MAX 2008</title>
		<link>http://blog.dclick.com.br/2008/11/14/adobe-max-2008/pt/</link>
		<comments>http://blog.dclick.com.br/2008/11/14/adobe-max-2008/pt/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 12:50:44 +0000</pubDate>
		<dc:creator>Rafael Martinelli</dc:creator>
		
		<category><![CDATA[Adobe]]></category>

		<category><![CDATA[MAX 2008]]></category>

		<guid isPermaLink="false">http://blog.dclick.com.br/?p=854</guid>
		<description><![CDATA[Mais um vez a DClick estará presente na MAX (conferencia mundial da Adobe) que acontecerá entre os dias 16 e 19 de novembro. Esperamos trazer em primeira mão as novidades direto das palestras aqui no blog da DClick.
Grande abraço.
]]></description>
			<content:encoded><![CDATA[<p>Mais um vez a DClick estará presente na <a href="http://max.adobe.com/">MAX</a> (conferencia mundial da Adobe) que acontecerá entre os dias 16 e 19 de novembro. Esperamos trazer em primeira mão as novidades direto das palestras aqui no blog da DClick.</p>
<p>Grande abraço.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dclick.com.br/2008/11/14/adobe-max-2008/pt/feed/pt/</wfw:commentRss>
		</item>
		<item>
		<title>Efeito Blur do Windows Vista no Flex</title>
		<link>http://blog.dclick.com.br/2008/11/11/efeito-blur-do-windows-vista-no-flex/pt/</link>
		<comments>http://blog.dclick.com.br/2008/11/11/efeito-blur-do-windows-vista-no-flex/pt/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 20:26:54 +0000</pubDate>
		<dc:creator>Beck Novaes</dc:creator>
		
		<category><![CDATA[Experience Design]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Flex Components]]></category>

		<guid isPermaLink="false">http://blog.dclick.com.br/?p=805</guid>
		<description><![CDATA[Sabe aquele efeito do Windows Vista que deixa borrado os elementos que estão de baixo de uma janela?

Bem, pode não parecer, mas isto tem um bom motivo para ser assim. Este post fala sobre este motivo e mostra como fazer isto no Flex (que pode não parecer, mas também não é tão simples assim).
Se tem [...]]]></description>
			<content:encoded><![CDATA[<p>Sabe aquele efeito do Windows Vista que deixa borrado os elementos que estão de baixo de uma janela?</p>
<p><img src="http://blog.dclick.com.br/wp-content/uploads/image11.jpg" alt="" title="Blur do Windows Vista" width="300" height="170" class="alignnone size-medium wp-image-807" /></p>
<p>Bem, pode não parecer, mas isto tem um bom motivo para ser assim. Este post fala sobre este motivo e mostra como fazer isto no Flex (que pode não parecer, mas também não é tão simples assim).</p>
<p>Se tem uma coisa que pode deixar o visual da sua aplicação Flex mais bonita é o uso do alpha. Mas o segredo para usar isto bem é equilibrar o quanto de transparência aplicar sem prejudicar a legibilidade de determinados elementos. </p>
<p>No Flex, por padrão, um TitleWindow vai usar a transparência desta forma:</p>
<p><img src="http://blog.dclick.com.br/wp-content/uploads/image22.jpg" alt="" title="image22" width="290" height="227" class="alignnone size-full wp-image-833" /></p>
<p>Porém, observe no exemplo acima como a leitura do título do Painel é prejudicada por causa da transparência. Mas eu não quero diminuir muito o nível de transparência. Então eu aplico um Blur apenas no que está em baixo do TitleWindow:</p>

<object	type="application/x-shockwave-flash"
			data="/sources/titleWindowOverBlur/TitleWindowOverBlurUsage.swf"
			width="590"
			height="500">
	<param name="movie" value="/sources/titleWindowOverBlur/TitleWindowOverBlurUsage.swf" />
</object>
<p></br></br><br />
Neste exemplo em Flex, enquanto você move o Title Window, o Blur é mostrado apenas nos elementos que estão em baixo dele.</p>
<p>Até parece simples fazer isto não é mesmo? Mas saiba que o Blur não pode ser aplicado no TitleWindow (isto deixaria apenas o TitleWindow desfocado ). Então a saída foi mesmo usar PopUpManager e máscara do Flash Player para resolver a questão. Curioso? Veja o código fonte (código fonte Botão Direito -> View Source). Não está nem aí para o código? Bem, se um dia você precisar deste efeito sabe onde encontrar.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dclick.com.br/2008/11/11/efeito-blur-do-windows-vista-no-flex/pt/feed/pt/</wfw:commentRss>
		</item>
		<item>
		<title>Aliando Teoria e Prática</title>
		<link>http://blog.dclick.com.br/2008/10/31/aliando-teoria-e-pratica/pt/</link>
		<comments>http://blog.dclick.com.br/2008/10/31/aliando-teoria-e-pratica/pt/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 13:06:17 +0000</pubDate>
		<dc:creator>Beck Novaes</dc:creator>
		
		<category><![CDATA[ActionScript]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[ProgramaÃ§Ã£o]]></category>

		<category><![CDATA[RIA]]></category>

		<guid isPermaLink="false">http://blog.dclick.com.br/?p=744</guid>
		<description><![CDATA[Eu acredito mesmo que aliar teoria e prática é a fórmula do sucesso. Os blogs que eu mais admiro (1, 2, 3, 4) pertencem a pessoas que parecem equilibrar bem estes dois fatores. 
As pessoas apenas pragmáticas não costumam ter blogs. Já as pessoas teóricas costumam ter, embora com um conteúdo geralmente prolixo e chato. [...]]]></description>
			<content:encoded><![CDATA[<p>Eu acredito mesmo que aliar teoria e prática é a fórmula do sucesso. Os blogs que eu mais admiro (<a href="http://www.codinghorror.com/blog/">1</a>, <a href="http://www.joelonsoftware.com/">2</a>, <a href="http://blog.fragmental.com.br/">3</a>, <a href="http://logbr.reflectivesurface.com/">4</a>) pertencem a pessoas que parecem equilibrar bem estes dois fatores. </p>
<p>As pessoas apenas pragmáticas não costumam ter blogs. Já as pessoas teóricas costumam ter, embora com um conteúdo geralmente prolixo e chato. Mas tem um outro tipo de pessoa, nem pragmática nem teórica, que costuma ter blog: o marketeiro. Estes geralmente tem muitas visitas, mas de cada 10 posts 9 são puro marketing pessoal. Confesso que isso me incomoda na medida em que os marketeiros costumam se gabar do número de visitas do seu blog e gostam de se vender como os melhores do mercado. Mas o que me deixa tranqüilo é o fato de saber que eles não constroem sua reputação em cima de algo louvável. Eles se elegem como os políticos do Brasil. Eles ficam famosos como os big Brothers. Eles, eventualmente, conseguem algumas vantagens competitivas como a Micro$oft. E de fato, eles não sabem aliar teoria e prática. </p>
<p>Bem, críticas a parte, analisando novamente um código que surgiu como <a href="http://groups.google.com/group/flexdev/msg/85ac1d5f03f9d25a">resposta a um problema na FlexDev</a>, eu senti a oportunidade de aliar teoria e prática. Não julgo que sei fazer isto bem, mas pelo menos é algo que eu busco. </p>
<p>Primeiro, algo útil para você usar caso precise um dia (prática). O exemplo abaixo mostra a utilização de um componente que permite facilmente associar funções a teclas de atalho no Flex.</p>
<p><em>(Para ver o código fonte: Botão direito - View Source)</em><br />

<object	type="application/x-shockwave-flash"
			data="/sources/ShortKey/ShortKeyUsage.swf"
			width="250"
			height="320">
	<param name="movie" value="/sources/ShortKey/ShortKeyUsage.swf" />
</object>
<p></br></br><br />
O ponto forte deste componente é a sua simplicidade de uso como mostra o exemplo:</p>
<p></p>
<div class="igBar"><span id="lcode-16"><a href="#" onclick="javascript:showPlainTxt('code-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-16">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;local:ShortKey key=<span style="color:#CC0000;">"{Keyboard.HOME}"</span> ctrlKey=<span style="color:#CC0000;">"true"</span> handler=<span style="color:#CC0000;">"{homeHandler}"</span> args=<span style="color:#CC0000;">"{['arg1', 'arg2']}"</span>/&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Você só precisa o trecho acima para que toda vez que a usuário pressionar CTRL + HOME a função "homeHandler" seja chamada recebendo os argumentos "arg1" e "arg2".</p>
<p>Agora um pouco de teoria que espero que também lhe seja útil de alguma forma. Isto tem a ver com abstração, pesquisa, nomes de variáveis e métodos e Refactoring. Tudo isto usando algo em torno de 10 linhas de código do componente e, prometo, tentarei não ser prolixo  (se bem que ao dizer que não serei prolixo eu já estou sendo uma vez que <a href="http://www.priberam.pt/dlpo/definir_resultados.aspx?prolixo">a palavra "prolixo" é prolixa em si</a>).</p>
<p>A primeira versão do componente tem o seguinte trecho de código:</p>
<h3>Exemplo 1</h3>
<p></p>
<div class="igBar"><span id="lcode-17"><a href="#" onclick="javascript:showPlainTxt('code-17'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-17">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">1</span>. <span style="">private</span> function keyDownHandler<span style="color:#006600; font-weight:bold;">&#40;</span>event:KeyboardEvent<span style="color:#006600; font-weight:bold;">&#41;</span>:void</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">2</span>. <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">3</span>. &nbsp;<span style="">var</span> checkShiftKey:Boolean = !<span style="color:#006600; font-weight:bold;">&#40;</span>Number<span style="color:#006600; font-weight:bold;">&#40;</span>event.<span style="">shiftKey</span><span style="color:#006600; font-weight:bold;">&#41;</span> ^ Number<span style="color:#006600; font-weight:bold;">&#40;</span>shiftKey<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">4</span>. &nbsp;<span style="">var</span> checkCtrlKey:Boolean = !<span style="color:#006600; font-weight:bold;">&#40;</span>Number<span style="color:#006600; font-weight:bold;">&#40;</span>event.<span style="">ctrlKey</span><span style="color:#006600; font-weight:bold;">&#41;</span> ^ Number<span style="color:#006600; font-weight:bold;">&#40;</span>ctrlKey<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">5</span>. &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">6</span>. &nbsp;<span style="">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>checkShiftKey &amp;&amp; checkCtrlKey<span style="color:#006600; font-weight:bold;">&#41;</span> &amp;&amp; event.<span style="">keyCode</span> == key<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">7</span>. &nbsp;<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">7</span>. &nbsp;&nbsp;<span style="">button</span>.<span style="">dispatchEvent</span><span style="color:#006600; font-weight:bold;">&#40;</span>new MouseEvent<span style="color:#006600; font-weight:bold;">&#40;</span>MouseEvent.<span style="">CLICK</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">8</span>. &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">9</span>. <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Bem, eu posso reescrever o trecho de código acima usando vários "ifs": </p>
<h3>Exemplo 2</h3>
<p></p>
<div class="igBar"><span id="lcode-18"><a href="#" onclick="javascript:showPlainTxt('code-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-18">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">1</span>. <span style="">private</span> function keyDownHandler<span style="color:#006600; font-weight:bold;">&#40;</span>event:KeyboardEvent<span style="color:#006600; font-weight:bold;">&#41;</span>:void</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">2</span>. <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">3</span>. &nbsp;<span style="">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>event.<span style="">keyCode</span> == key<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">4</span>.&nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">5</span>.&nbsp; &nbsp; <span style="">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>event.<span style="">shiftKey</span> &amp;&amp; shiftKey<span style="color:#006600; font-weight:bold;">&#41;</span> || event.<span style="">ctrlKey</span> &amp;&amp; ctrlKey<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">6</span>.&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">7</span>.&nbsp; &nbsp; &nbsp; <span style="">handler</span>.<span style="">apply</span><span style="color:#006600; font-weight:bold;">&#40;</span>document, args<span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">8</span>.&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">9</span>.&nbsp; &nbsp; <span style="">else</span> if <span style="color:#006600; font-weight:bold;">&#40;</span>!event.<span style="">shiftKey</span> &amp;&amp; !shiftKey &amp;&amp; !event.<span style="">ctrlKey</span> &amp;&amp; !ctrlKey<span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">10</span>.&nbsp;&nbsp;<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">11</span>.&nbsp;&nbsp;&nbsp;<span style="">handler</span>.<span style="">apply</span><span style="color:#006600; font-weight:bold;">&#40;</span>document, args<span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">12</span>.&nbsp;&nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">13</span>.&nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">14</span>. <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>O que tornou possível remover os "ifs" (exemplo 2) foi o uso do <a href="http://en.wikipedia.org/wiki/Bitwise_XOR#XOR">Bitwise XOR</a> (o sinal ^ no exemplo 1). E o que tornou possível o uso do XOR foi a abstração. Eu percebi que o que importava para resolver meu problema é que o resultado da comparação entre dois valores booleanos fosse verdadeira caso os valores fossem iguais (<em>verdadeiro e verdadeiro = verdadeiro</em> <strong>ou</strong> <em>falso e falso = verdadeiro</em>). Então, se houvesse uma maneira de verificar isto eu não precisaria de vários "ifs" para testar diversas situações. Eu lembrava das aulas de lógica da faculdade de Ciência da Computação que tinha uma notação que representava este cenário. Logo, imaginei que deveria haver uma forma de escrever isto numa linguagem de programação como o ActionScript. Isto foi comprovado minutos depois de uma rápida <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=03_Language_and_Syntax_14.html">pesquisa no Help</a>. Assim, a linha 3 e a linha 4 do exemplo 1 garantem que o resultado será verdadeiro caso ambos os valores envolvidos no XOR sejam verdadeiros ou ambos sejam falsos.</p>
<p>O "if", assim como as estruturas de repetição, são alguns dos itens que adicionam complexidade num algoritmo e sempre que posso eu tento reduzi-los. Mas neste caso o uso do operador Bitwise XOR conseguiu deixar as coisas mais complexas ainda. </p>
<p>Então pensei em adicionar comentários para deixar as coisas mais claras:</p>
<h3>Exemplo 3</h3>
<p></p>
<div class="igBar"><span id="lcode-19"><a href="#" onclick="javascript:showPlainTxt('code-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-19">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">1</span>. <span style="">private</span> function keyDownHandler<span style="color:#006600; font-weight:bold;">&#40;</span>event:KeyboardEvent<span style="color:#006600; font-weight:bold;">&#41;</span>:void</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">2</span>. <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">3</span>. &nbsp;<span style="color:#FF9933; font-style:italic;">// garante que ambos os valores do shift são falsos ou verdadeiros</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">4</span>.&nbsp; <span style="color:#FF9933; font-style:italic;">// os valores do shift são definidos pela propriedade shiftKey desta classe</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">5</span>.&nbsp; <span style="color:#FF9933; font-style:italic;">// e pela propriedade shiftKey do objeto event</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">6</span>.&nbsp; <span style="">var</span> areShiftValuesFalseOrTrue:Boolean = !<span style="color:#006600; font-weight:bold;">&#40;</span>Number<span style="color:#006600; font-weight:bold;">&#40;</span>event.<span style="">shiftKey</span><span style="color:#006600; font-weight:bold;">&#41;</span> ^ Number<span style="color:#006600; font-weight:bold;">&#40;</span>shiftKey<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">7</span>.&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">8</span>.&nbsp; <span style="color:#FF9933; font-style:italic;">// garante que ambos os valores do ctrl são falsos ou verdadeiros</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">9</span>.&nbsp; <span style="color:#FF9933; font-style:italic;">// os valores do ctrl são definidos pela propriedade ctrlKey desta classe</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">10</span>.&nbsp;<span style="color:#FF9933; font-style:italic;">// e pela propriedade ctrlKey do objeto event</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#800000;color:#800000;">11</span>.&nbsp;<span style="">var</span> areCtrlValueFalseOrTrue:Boolean = !<span style="color:#006600; font-weight:bold;">&#40;</span>Numbe