Wednesday, November 19, 2014

IIS Error: Cannot write configuration file


When trying to change IIS configuration, got this error message:
    Error: Cannot write configuration file

Error Message


Turns out root cause of the problem is a full C: drive.

Windows Explorer


Luckily, this is a virtual machine with some spare disk capacity. So it's just a matter of allocating more resource, then extend C: drive.

Wednesday, November 05, 2014

Flex TextArea problem in DataGrid


Flex 4 TextArea does not take multi-line entry when used as editor in DataGrid.


Add editorUsesEnterKey="true" attribute to the column with TextArea editor.


The solution is straightforward. But the route to finding this solution kind of proves open source or at least show your customer the source code is very important.

I first suspect the enter key is intercepted by DataGrid, but it appears that keydown event is intercepted by DataGrid before the TextArea. Some Googling with various keyword combination did not turn up anything interesting.

Not sure where to start, I added a itemEditEnd event handler to the DataGrid, and set a breakpoint there. After walking through the stack, I saw the following code segment, and thus the solution above pops out. Now I can simply go to documentation of editorUsedEnterKey and make sure this is what I want.

(Code of interest from
     *  @private
    private function editorKeyDownHandler(event:KeyboardEvent):void
        // ESC just kills the editor, no new data
        if (event.keyCode == Keyboard.ESCAPE)
        else if (event.ctrlKey && event.charCode == 46)
        {   // Check for Ctrl-.
        else if (event.charCode == Keyboard.ENTER && event.keyCode != 229)
            // multiline editors can take the enter key.
            if (!_editedItemPosition)

            if (columns[_editedItemPosition.columnIndex].editorUsesEnterKey)

            // Enter edits the item, moves down a row
            // The 229 keyCode is for IME compatability. When entering an IME expression,
            // the enter key is down, but the keyCode is 229 instead of the enter key code.
            // Thanks to Yukari for this little trick...
            if (endEdit(DataGridEventReason.NEW_ROW) && !dontEdit)
                if (focusManager)
                    focusManager.defaultButtonEnabled = false;