<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8695242072531068788</id><updated>2011-11-27T16:25:09.946-08:00</updated><title type='text'>Wagner Mezaroba</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://wagnermezaroba.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8695242072531068788/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://wagnermezaroba.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Wagner Mezaroba</name><uri>http://www.blogger.com/profile/09621847359651684917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/-vOBxVnLdCeA/Tg6OuWM1KTI/AAAAAAAAADA/Op3nu1wfPfU/s220/IMG_0033_square_lighter_comp.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8695242072531068788.post-2563181322596879752</id><published>2011-07-01T20:12:00.000-07:00</published><updated>2011-07-01T20:17:46.272-07:00</updated><title type='text'>Using commas instead of dots to represent decimal numbers in Flex NumericStepper</title><content type='html'>When we need to specify a decimal number here in Brazil (and in many other countries) we usually do not use dots. We use commas. So, instead of writing U$1&lt;span style="font-weight: bold;"&gt;.&lt;/span&gt;26 to represent one dollar and twenty-six cents, we write U$1&lt;span style="font-weight: bold;"&gt;,&lt;/span&gt;26.&lt;br /&gt;&lt;br /&gt;The problem is that when we're using a Flex NumericStepper there isn't a place to set this. The only way I've found to get NumericStepper working with commas was to change the behaviour of the NumericStepper's TextInput. So I've created a different TextInput, called BrazilianNumberTextInput. Here it is:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: csharp"&gt;package com.blogspot.wagnermezaroba.components&lt;br /&gt;{&lt;br /&gt;  import mx.controls.TextInput;&lt;br /&gt;&lt;br /&gt;  public class BrazilianNumberTextInput extends TextInput {&lt;br /&gt;   &lt;br /&gt;      override public function get text():String {&lt;br /&gt;          var t:String = super.text;&lt;br /&gt;          if ( t != null )&lt;br /&gt;              t = t.replace(/\./g, '').replace(/,/g, '.');&lt;br /&gt;          return t;&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;What I've done is simple. I replaced all the dots for nothing (that was the desired effect that we needed) and all the commas for dots. So NumericStepper will be able to parse the values. But we need to set NumericStepper to use our new TextInput component. I've done this in my css file:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: csharp"&gt;mx|NumericStepper {&lt;br /&gt;  textInputClass: ClassReference("com.blogspot.wagnermezaroba.components.BrazilianNumberTextInput");&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It's an ugly solution. But I haven't found any solution on the internet and so far I do not believe there is a different way to go.&lt;br /&gt;&lt;br /&gt;And that's it. If you're going to use it, it would be good to set the restrict property, to constrain the user input and allow just numbers and commas.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8695242072531068788-2563181322596879752?l=wagnermezaroba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wagnermezaroba.blogspot.com/feeds/2563181322596879752/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8695242072531068788&amp;postID=2563181322596879752' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8695242072531068788/posts/default/2563181322596879752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8695242072531068788/posts/default/2563181322596879752'/><link rel='alternate' type='text/html' href='http://wagnermezaroba.blogspot.com/2011/07/using-commas-instead-of-dots-to.html' title='Using commas instead of dots to represent decimal numbers in Flex NumericStepper'/><author><name>Wagner Mezaroba</name><uri>http://www.blogger.com/profile/09621847359651684917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/-vOBxVnLdCeA/Tg6OuWM1KTI/AAAAAAAAADA/Op3nu1wfPfU/s220/IMG_0033_square_lighter_comp.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8695242072531068788.post-1857793620105778555</id><published>2011-05-31T18:34:00.000-07:00</published><updated>2011-05-31T18:44:02.621-07:00</updated><title type='text'>Enter working as Tab in a Flex DataGrid</title><content type='html'>&lt;p style="text-align:justify; margin-bottom: 0px"&gt;If you're using a Flex DataGrid with the editable property set to true, the default behaviour of the Tab key is moving from one editable cell to another one while the Enter key move from one row to another one. There isn't any DataGrid option to easily make Enter key behaves like Tab key. And you can't override the KEY_DOWN event handler method of the DataGrid directly. However, you can register your own handler with a higher priority than the default DataGrid handler. By doing this, your handler will be called before DataGrid handler giving you the possibility to customize the action of the pressed keys. That's what we're going to do.&lt;/p&gt;&lt;br /&gt;&lt;p style="text-align:justify"&gt;In your own handler you can check if the pressed key is Enter and than simply stop the propagation of the KeyboardEvent. Ok, this disables the default Enter event. But how can we make Enter works as Tab? We can just dispatch a fake KEY_FOCUS_CHANGE event. And that's it! Let's see the code:&lt;/p&gt;&lt;br /&gt;&lt;pre class="brush: csharp"&gt;&lt;br /&gt;public class CustomDataGrid extends DataGrid {&lt;br /&gt;&lt;br /&gt;   public function CustomDataGrid() {&lt;br /&gt;       super();&lt;br /&gt;   }&lt;br /&gt; &lt;br /&gt;   /*&lt;br /&gt;    * After Flex register its own handler in the createItemEditor method,&lt;br /&gt;    * we register our event listener with a higher priority (100).&lt;br /&gt;    */&lt;br /&gt;   override public function createItemEditor(colIndex:int, rowIndex:int):void {&lt;br /&gt;       super.createItemEditor(colIndex, rowIndex);          &lt;br /&gt;       DisplayObject(itemEditorInstance).addEventListener(KeyboardEvent.KEY_DOWN, onEditorKeyDown, false, 100);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   /*&lt;br /&gt;    * If the pressed key is Enter, stop the propagation and&lt;br /&gt;    * dispatch a fake Tab Event.&lt;br /&gt;    */  &lt;br /&gt;   protected function onEditorKeyDown(event:KeyboardEvent):void {&lt;br /&gt;       if (event.charCode == Keyboard.ENTER &amp;amp;&amp;amp; event.keyCode != 229) {&lt;br /&gt;           event.stopImmediatePropagation();&lt;br /&gt;           dispatchEvent(new FocusEvent(FocusEvent.KEY_FOCUS_CHANGE, true, false, null, event.shiftKey, Keyboard.TAB));&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Be careful with itemRenderers and itemEditors&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p style="text-align:justify"&gt;If you are using a custom itemRenderer or itemEditor, I recommend you to pay attention to the events they dispatch. They can dispatch extra events that make your Enter key not behaves exactly like the Tab key, specially if you're listening to the ITEM_EDIT_END event. It depends on the case, but if you're having problems with this use the same technique to interrupt not convenient events on your itemEditor or itemRenderer.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;And that's it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8695242072531068788-1857793620105778555?l=wagnermezaroba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wagnermezaroba.blogspot.com/feeds/1857793620105778555/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8695242072531068788&amp;postID=1857793620105778555' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8695242072531068788/posts/default/1857793620105778555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8695242072531068788/posts/default/1857793620105778555'/><link rel='alternate' type='text/html' href='http://wagnermezaroba.blogspot.com/2011/05/enter-working-as-tab-in-flex-datagrid.html' title='Enter working as Tab in a Flex DataGrid'/><author><name>Wagner Mezaroba</name><uri>http://www.blogger.com/profile/09621847359651684917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/-vOBxVnLdCeA/Tg6OuWM1KTI/AAAAAAAAADA/Op3nu1wfPfU/s220/IMG_0033_square_lighter_comp.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8695242072531068788.post-8377856680279734203</id><published>2009-08-05T11:10:00.000-07:00</published><updated>2009-08-05T11:11:45.387-07:00</updated><title type='text'>Zope 3 no Ubuntu Jaunty -(9.04)</title><content type='html'>Comecei a estudar Zope recentemente e, quando fui instalar o Zope 3 no Ubuntu 9.04 tive um pequeno contratempo. Não sei se é algo comum, mas não achei uma resposta na web (procurei tão pouco que pode ser que tenha). Basicamente, após ter instalado o pacote zope3 e ter criado uma instância do zope da seguinte maneira:&lt;br /&gt;&lt;br /&gt;$sudo /usr/lib/zope3/bin/mkzopeinstance&lt;br /&gt;&lt;br /&gt;eu tentava subir o Zope com:&lt;br /&gt;&lt;br /&gt;$sudo /etc/init.d/zope3&lt;br /&gt;&lt;br /&gt;e a instância simplesmente falhava. Então tentei subir a instância diretamente com:&lt;br /&gt;&lt;br /&gt;$sudo /local_da_minha_instancia/test/bin/zopectl fg&lt;br /&gt;&lt;br /&gt;E foi acusado um erro no arquivo /local_da_minha_instancia/test/etc/zdaemon.conf. Basicamente faltava colocar um % em frente ao define da segunda linha. Coloquei e resolveu meu problema.&lt;br /&gt;&lt;br /&gt;Acredito que esse arquivo seja gerado automaticamente, daí o erro. De qualquer maneira deixo relatado aqui pra quem tiver o mesmo problema (ou uma explicação melhor pra ele!).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Abraço.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8695242072531068788-8377856680279734203?l=wagnermezaroba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wagnermezaroba.blogspot.com/feeds/8377856680279734203/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8695242072531068788&amp;postID=8377856680279734203' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8695242072531068788/posts/default/8377856680279734203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8695242072531068788/posts/default/8377856680279734203'/><link rel='alternate' type='text/html' href='http://wagnermezaroba.blogspot.com/2009/08/zope-3-no-ubuntu-jaunty-904.html' title='Zope 3 no Ubuntu Jaunty -(9.04)'/><author><name>Wagner Mezaroba</name><uri>http://www.blogger.com/profile/09621847359651684917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/-vOBxVnLdCeA/Tg6OuWM1KTI/AAAAAAAAADA/Op3nu1wfPfU/s220/IMG_0033_square_lighter_comp.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8695242072531068788.post-8272987943895497675</id><published>2009-08-05T11:04:00.000-07:00</published><updated>2009-08-05T11:10:16.752-07:00</updated><title type='text'>Hello World!</title><content type='html'>Pra iniciar bem, nada melhor do que o bom e velho Hello World. Afinal de contas, todo mundo começa assim. Nesse blog vou postar um pouco sobre o que eu tenho estudado sobre desenvolvimento de software. Provavelmente o que eu postarei aqui atualmente será a respeito de Java, Ruby e Python que é o que tenho estudado.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Até!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8695242072531068788-8272987943895497675?l=wagnermezaroba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wagnermezaroba.blogspot.com/feeds/8272987943895497675/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8695242072531068788&amp;postID=8272987943895497675' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8695242072531068788/posts/default/8272987943895497675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8695242072531068788/posts/default/8272987943895497675'/><link rel='alternate' type='text/html' href='http://wagnermezaroba.blogspot.com/2009/08/hello-world.html' title='Hello World!'/><author><name>Wagner Mezaroba</name><uri>http://www.blogger.com/profile/09621847359651684917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/-vOBxVnLdCeA/Tg6OuWM1KTI/AAAAAAAAADA/Op3nu1wfPfU/s220/IMG_0033_square_lighter_comp.JPG'/></author><thr:total>0</thr:total></entry></feed>
