I've tried using a popup TextArea but I'm having real problems trying to get
it to work as an item editor
within a datagrid.

My business requirements are

- someone can click in the DG cell to start editing. If the cell uses a
TextArea control, they should get popup-like TA that extends across rows to
enter longer blocks of text
- the user can enter data in any text-based editable cell without using a
mouse (but they can use a mouse if they want to)
- someone can tab across a row in the DG; our DG needs to move from one
editable cell to the next (and go to next editable row if they tab out of
the last editable cell in a row)
- the user can use shift-tab to go to previous editable cell
- the user can use ENTER to finish the edit and save the row
- the user can use ESCAPE to cancel the edit

So I've already got all of the keyboard behavior working with a TextField
controls. It also works if I use a simple TextArea as the item editor (but
see if the beginning of the thread for my problem with a simple TextArea).

However, when I open the TextArea with a PopUpManager I'm having problems.
My custom item editor is composed of a Canvas:

    public class PopUpTextArea extends Canvas
        implements IDropInListItemRenderer, IFocusManagerComponent

On creationComplete, the editor creates a new instance of TextArea, and uses
PopUpManager to open it.

                _popup = new TextArea();
                _popup.width= this.width;
                _popup.height= EDIT_HEIGHT;
                _popup.text = this._text;
                _popup.owner = this;

                PopUpManager.addPopUp(_popup, this, false);
                PopUpManager.bringToFront(_popup);

But ...

If I try to programmatically set focus on the popup, the DG crashes.
Apparently, it's getting wrapped around a pole somehow because setting focus
on the popup triggers an item-edit-end.  If I click in the TA, it either (A)
goes in a little circle - item-edit-end is called because the Canvas losses
focus, so it
closes the TA, but the editedItemPosition doesn't move, so it creates a new
instance of the editor which opens the popup, or (B) it just closes the
item-editor
because the item-editor lost focus

I also tried to capture keystrokes on the Canvas and pass them to the TA,
that didn't work either. But even if it did work, the user still needs the
ability
to use the mouse if they want to.

So is it possible to use a TextArea in a PopUp as an item editor in a
DataGrid?


On Fri, Jul 18, 2008 at 4:42 PM, Alex Harui <[EMAIL PROTECTED]> wrote:

>    Well, you could popup a TextArea like PopUpButton does, but it sounds
> like your real goal is to have the TA extend across rows and not be below
> the lines.  I assume you don't want the TA to fit within a single row?
>
>
>
> How will you handle the area at the bottom of the DG?  If I click the last
> row, should the TA extend two rows below the DG?
>
>
>  ------------------------------
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Glenn Jones
> *Sent:* Friday, July 18, 2008 11:17 AM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] TextArea popup editor in DataGrid
>
>
>
> I have a DataGrid where one of the columns is a TextArea control as the
> itemEditor.
>
> When I edit a cell in the column with the TextArea editor, the TextArea
> opens up to a height equivalent to
> three rows of data in the grid. The editor works fine; in fact it's been
> working this way for some time.
>
> But recently, we enabled horizontal and vertical grid lines on the grid.
> When the TextArea editor opens up,
> the datagrid horizontal grid lines are drawn across the top of the control.
>
> I've verified that the TextArea control is not inheriting the styles
> related to grid lines
> I've verified that the TextArea backgroundAlpha is 1; i.e. the text on the
> rows underneath the editor is not
> showing through.
>
> So as near as I can tell, the grid is drawing the gridlines on top of the
> editor.
>
> Curiously, I also have a PopUpButton editor type - it does not have grid
> lines drawn across when the dropdown
> area that appears when the button is activated.
>
> Is this a known issue? Is there a workaround?
>
> Thanks
>
>    
>

Reply via email to