With backgroundAlpha=1, the box always has the white background, whether
it's selected or not:
http://dl.getdropbox.com/u/15760/alpha1.PNG

With backgroundAlpha=0, the box never has a white background, even when it
is selected:
http://dl.getdropbox.com/u/15760/alpha0.PNG

Both of these ways are inconsistent with the typical appearance of a
DataGridColumn.  That's all I'm going for- for it to look white when it
should (when it's in edit mode) and not white when it shouldn't (when it's
not being edited.)

I was completely overlooking the fact that you can have a renderer and an
editor.  I got it looking right by doing this:

<mx:DataGridColumn dataField="username" headerText="Username"/>
<mx:DataGridColumn dataField="password" headerText="Password"
editorDataField="text">
    <mx:itemEditor>
        <mx:Component>
            <mx:TextInput displayAsPassword="true" borderStyle="none"
backgroundAlpha="1"/>
        </mx:Component>
    </mx:itemEditor>
    <mx:itemRenderer>
        <mx:Component>
            <mx:TextInput displayAsPassword="true" borderStyle="none"
backgroundAlpha="0"/>
        </mx:Component>
    </mx:itemRenderer>
</mx:DataGridColumn>

The look I was going for:
http://dl.getdropbox.com/u/15760/correct.PNG


Thanks for the help!


On Wed, Jun 11, 2008 at 1:31 AM, <> wrote:

>    A TextInput just contains a TextField and draws border and background
> around it.  DGIR extends TextField.  If you're ok with popup editors, I'd
> extends both DGIR as the renderer and TextInput as the editor.
>
>
>
> If you really need TextInput as the renderer, try setting
> backgroundColor="".  I'm not sure I understand what was wrong about
> backgroundAlpha=0
>
>
>  ------------------------------
>
> *From:* [email protected] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Dennis Falling
> *Sent:* Tuesday, June 10, 2008 10:04 PM
> *To:* [email protected]
> *Subject:* Re: [flexcoders] Datagrid Password Column?
>
>
>
> I'm trying to make an editable password column in a datagrid that displays
> asterisks instead of the characters of the string that it's displaying.
> Simply using a TextInput with displayAsPassword does exactly this, but when
> the row is selected (whether the password field is selected or not), the
> password field has a solid white background.  This looks inconsistent
> compared to other editable column fields, so I'm hoping someone has a trick
> to fix this.  As Tracy suggested, I can make it's background alpha 0, but
> then it doesn't look right when it's selected.  This may seem petty, but it
> looks wrong.
>
> I can always create an item renderer that emulates the TextInput's
> displayAsPassword property, but I'm so close now, and was hoping there's a
> trick I'm missing to get this working.
>
>
>  On Tue, Jun 10, 2008 at 11:56 PM, Alex Harui <[EMAIL PROTECTED]> wrote:
>
> Maybe I don't understand what you want.  Do you want rendererIsEditor or do
> you want an editor to popup over the cell?  My first instinct would be to
> have an editor popup over the cell so rendererIsEditor=false, and I subclass
> DGIR as the column renderer, and supply a custom TextInput as the editor
> with displayAsPassword=false.
>
>
>  ------------------------------
>
> *From:* [email protected] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Dennis Falling
> *Sent:* Tuesday, June 10, 2008 9:44 PM
> *To:* [email protected]
> *Subject:* Re: [flexcoders] Datagrid Password Column?
>
>
>
> I tried doing the same thing I'm doing now, except moving the TextInput
> into an external item renderer and listening for begin/end edit events to
> toggle the alpha, but that seemed really clunky.  So you're saying that is
> probably the best way?
>
> On Tue, Jun 10, 2008 at 11:34 PM, Alex Harui <[EMAIL PROTECTED]> wrote:
>
> You should be able to use DataGridItemRenderer and set its
> displayAsPassword=true in a subclass or in a custom classFactory
>
>
>  ------------------------------
>
> *From:* [email protected] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Tracy Spratt
> *Sent:* Tuesday, June 10, 2008 6:06 PM
> *To:* [email protected]
> *Subject:* RE: [flexcoders] Datagrid Password Column?
>
>
>
> Maybe set backgroundAlpha="0"?
>
> Tracy
>
>
>  ------------------------------
>
> *From:* [email protected] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Dennis Falling
> *Sent:* Tuesday, June 10, 2008 7:28 PM
> *To:* [email protected]
> *Subject:* [flexcoders] Datagrid Password Column?
>
>
>
> I have an editable DataGrid that displays usernames and masked passwords
> (********).  To hide the password, I'm just using an inline item renderer:
>
> <mx:DataGridColumn dataField="password" headerText="Password"
> editorDataField="text" rendererIsEditor="true">
>     <mx:itemRenderer>
>         <mx:Component>
>             <mx:TextInput displayAsPassword="true" borderStyle="none"/>
>         </mx:Component>
>     </mx:itemRenderer>
> </mx:DataGridColumn>
>
> This works exactly how I want it to, with very little code...except it
> doesn't look too hot when that row is selected: the TextInput always has a
> solid white background whether it's selected or not.  Is there an easy way
> to tell it to make it not show a background except when selected (appear
> like the default item editor)?  I've listened to the various edit events but
> can't figure out a clean way of doing this.
>
> Thanks!
>
>
>
>
>
>  
>

Reply via email to