> �(Dick, that sounds like an interesting sample file... any total
> filesize
> comparisons, controls against display choices, etc? Usually people
> see the
> opposite of what you reported, so it would be good to learn the
> crucial
> differences, thanks.)
>
>
John
Actually, I fudged the way I stated the problem a bit -- in favor of
Flash; Instead of refreshing the entire grid all 30/20 cells. all the
Flash Remoting version did was refresh a random 5 cells and set them to
a random color. so the grids after the first was 5 x 5.
To restate the problem correctly:
7-8 sec --- Flash Remotiing - update the value and color of a
random 5 cells in a 30 x 20 dataGrid.
4-6 sec --- Pure html page refresh 30 x 20 table (values and
colors) plus some additional html (totals, etc))
3-5 sec --- Hidden Frame & _javascript_ transmit entire page +
thinArray of changes to hidden frame. The html is
ignored (not rendered) and _javascript_ populates the
cells that change*
* This is a partial implementation -- I left the html in for debugging
purposes. the thinArray averages about 450 cells. and about 6.5K.
At this point the thin array contains actual html for:
cell number |
cellcolor |
cell value |
for each cell changed
here is one of the commands to generate a thinArray entry.
<cfset ChangeList = ChangeList & CellCount-1 & "|" &
"###Variables.LowTickColor#" & "|" & NumberFormat(Variables.Quote,
'-999,999.99') & "|"/>
part of the thin array looks like this (new lines added for clarity):
9|#66FF66|<b> 14.70</b>|
10|#E0E0E0|<b><font color="#990000"> -0.87</b></font>|
11|#E0E0E0|<b><font color="#990000"> -5.59%</b></font>|
13|#FF6666|<b> -108.75</b>|
15|#006699|<b> 1,830.50</b>|
27|#FFFFFF|<b>14.70</b>|
28|#FFFFFF|<b><font color="#990000"> -0.87</b></font>|
*
*
*
The js just creates an arrayfrom the thinarray and iterates over it
setting the corresponding table cell background and value:
//populate array from thinArray
top.Data.l0 = top.Buffer.l0.split("|");
//request next changes from host
top.Buffer.document.location =
"HTMLHiddenFrameGetChanges_ServerToBuffer.cfm";
//iterate over array changing background of corresponding table cell
for(i=0; i < top.Data.l0.length; i=i+3) {
top.Display.document.getElementById(top.Data.l0[i]).style.background =""> top.Data.l0[i+1].toString();
top.Display.document.getElementById(top.Data.l0[i]).innerHTML =
top.Data.l0[i+2];
}
Below is the cfc function used in the Flash Remoting tests.
Dick
<cffunction name="getChanges" returntype="query" access="remote">
<cfset var result = "">
<cfparam Name="Session.CurrentChangeValue" Default=0/>
<cfparam Name="Session.CurrentChangeColor" Default="0x990000"/>
<cfset Variables.StartTime = GetTickCount()/>
<cfset GridColumnNames =
"C00_TickerSymbol,C01_DaysHeld,C02_Support,C03_Resistance,C04_Qty,C05_Bu
yPrice,C06_PrevClose,C07_HighPrice,C08_LowPrice,C09_LastPrice,C10_PriceC
hange,C11_Pergentage,C12_StockValue,C13_ValueChange,C14_Paid,C15_GainLos
s,C16_ROI"/>
<cfset ChangeQuery = QueryNew(
"ChangeRowNumber,
ChangeColumnName,
ChangeColumnNumber,
ChangeValue,
ChangeColor"
)>
<cfloop index="Index" From=1 TO=5>
<cfset Session.CurrentChangeValue = Session.CurrentChangeValue + 1/>
<cfif (Session.CurrentChangeValue) MOD 2>
<cfset Session.CurrentChangeColor = "0x990000"/>
<cfelse>
<cfset Session.CurrentChangeColor = "0x009900"/>
</cfif>
<cfset Variables.ChangeColumnName = ListGetAt(GridColumnNames,
RandRange(1,17))/>
<cfset Variables.ChangeColumnNumber =
ListFind(GridColumnNames,Variables.ChangeColumnName) - 1/>
<cfset newRow = QueryAddRow(ChangeQuery, 1)>
<cfset temp =
QuerySetCell(ChangeQuery, "ChangeRowNumber", RandRange(0, 29),
Index)/>
<cfset temp = QuerySetCell(ChangeQuery,
"ChangeColumnName", Variables.ChangeColumnName, Index)/>
<cfset temp = QuerySetCell(ChangeQuery,
"ChangeColumnNumber", Variables.ChangeColumnNumber, Index)/>
<cfset temp = QuerySetCell(ChangeQuery,
"ChangeValue", Session.CurrentChangeValue, Index)/>
<cfset temp = QuerySetCell(ChangeQuery, "ChangeColor",
Session.CurrentChangeColor, Index)/>
</cfloop>
<cfset result=ChangeQuery/>
<!---
<cfoutput><br>Elapsed time: #GetTickCount() -
Variables.StartTime#|</cfoutput>
<cfdump var=#ChangeQuery# label="ChangeQuery"/>
--->
<cfreturn result>
</cffunction>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

