Archive for July, 2010

Posted by Tatyana at 24 July 2010

Category: Dev, Flex

Tags: , , ,

I was trying to solve a problem of resetting a focus if the parent changes. I had different buttons that show the same .mxml-form but with different data. The problem was that I needed the focus to be on the first date-field whenever the form is shown so that the user can begin typing data right away.

<mx:HBox>
       <mx:Button id="noData" click="showPanelWithNoData()" />
       <mx:Button id="someData" click="showPanelWithSomeData()" />
       <mx:Button id="withData" click="showPanelWithData()" />

       <myCustomForm:DataForm width="100%" />
</mx:HBox>

So for each time one of the buttons is pushed I need the focus to be on myDate-field. To solve the problem I used “updateComplete“-property of the field.

DataForm.mxml

<?xml version="1.0" encoding="utf-8"?>
<DataForm
    xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        <![CDATA[
            import mx.managers.FocusManager;

            private function resetFocus():void {
                if (focusManager != null && myDate.focusManager != null) {
                    focusManager.setFocus(myDate);
                }
            }
        ]]>
    </mx:Script>

    <mx:FormItem>
        <mx:TextField id="myDate"
            updateComplete="resetFocus()"/>
    </mx:FormItem>

</DataForm>

Posted by kent at 4 July 2010

Category: Memorable

Tags: ,

1. Painters need to start painting the interiors before the house foundation is started on.

2. Carpenters must finish the roof before the walls are strong enough to support it.

3. The exterior should look like gold, but in reality made of mud.

4. Skip the foundation. Nobody will ever care to take a look there, or have access there.

5. The electricity, water pipes and waste disposal can go through the same pipe.

6. When the house is almost finished, the owner wants to move a couple of walls, add some floors, at no extra cost.

7. When the house is “finished”, the owner must expect to patch it up when it rains, apply service personell monthly and within 2 years the house it out of date.