The TextInput is kind enough to do a toString() on anything passed to 
its .text property, which is great for Number and other things, but 
is the root of your problem.

My advice, subclass TextInput and put the null check on the text 
setter.

-Alex

--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> 
wrote:
> First, I haven't noticed this behavior, but that doesn't mean 
much.  I
> assume you are binding the textInput to the selectedItem of the
> datagrid? If you don't have control over the data source, you can 
use
> the "ternary" expression format:
> Text="{(myDataGrid.selectedItem.myProperty == null ) ? "" :
> myDataGrid.selectedItem.myProperty }"
> 
> Also, when a value in a dataProvider is null or undefined, it can 
cause
> some odd display behaviors in the Datagrid, where a newly updated 
cell
> does not display until you mouseover or select it.
> 
> Tracy
> 
> 
> -----Original Message-----
> From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
> Behalf Of jamiebadman
> Sent: Tuesday, May 31, 2005 10:25 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Hiding 'Null'...
> 
> Hi,
> 
> I have a datagrid and some detail boxes (mostly textInput). If a 
> column is null on the grid, it shows as an empty cell - which is 
what 
> I want (looks best that way) but the data is shown as 'null' in the 
> textInput box.
> 
> Is there an easy way to prevent this from happening - and simply 
not 
> showing anything at all in the textInput box when there's a null in 
> the data ?
> 
> The 'null' appears as actual text in the textInput box btw - so if 
I 
> then save the data, I'll get the string 'null' saved to the DB!
> 
> Thanks in advance,
> 
> Jamie.
> 
> 
> 
> 
> 
>  
> Yahoo! Groups Links




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to