all groups > macromedia flash flash remoting > march 2004 >
You're in the

macromedia flash flash remoting

group:

Recordset Null Values


Recordset Null Values TheScarecrow
3/23/2004 3:21:02 PM
macromedia flash flash remoting:
I have a coldfusion database that I am pulling employee data from. There are
portions of the database that are NULL or empty based on the employee. How do
I prevent Flash from displaying NULL as a value. Can you loop through the
records values and replace them with " " if they are null? or do I have to test
each column in the record for a null value. There are 31 columns in the
database. I am using the script:

textbox.htmlText=(result.items[0].columntitle)

I dont want to have to test all 31 before placing them in the text fields.
Does anyone have a solution for this.
Re: Recordset Null Values jimfree
3/31/2004 4:16:22 PM
Some time ago I found this solution, don't remember where, probably this forum.
But I made the change indicated below to the DataGlue.as file and it cured my
problem with the word null being displayed instead of just leaving the field
blank.

As always, backup your orignal before making the changes.

Change as follows:

As it currently reads.....

_global.DataGlue.getItemAt_FormatString = function(index)
{
var record = this.dataProvider.getItemAt(index);
if (record == "in progress" || record==undefined){
}else{
return {label: this.format(this.labelString, record), data: (this.dataString
== null) ? record : this.format(this.dataString, record)};
}
}


_global.DataGlue.getItemAt_FormatFunction = function(index)
{
var record = this.dataProvider.getItemAt(index);
if (record == "in progress" || record==undefined) {
}else{
return this.formatFunction(record);
}
}



After changes are made....


_global.DataGlue.getItemAt_FormatString = function(index)
{
var record = this.dataProvider.getItemAt(index);
if (record == "in progress" || record==undefined)
return record;
return {label: this.format(this.labelString, record), data: (this.dataString
== null) ? record : this.format(this.dataString, record)};
}

_global.DataGlue.getItemAt_FormatFunction = function(index)
{
var record = this.dataProvider.getItemAt(index);
if (record == "in progress" || record==undefined)
return record;
return this.formatFunction(record);
}



Re: Recordset Null Values Pete
4/9/2004 12:56:31 AM
As an alternative, couldn't you modify your SQL to do this at SELECT time?

[quoted text, click to view]

AddThis Social Bookmark Button