3.0.5

Large XML documents. Sort & Search experiences

Hello Alex, hello everybody,

First of all: excuse my poor english... I hope you understand this.

I´m currently using ActiveWidGets v1.0.2 GPL Version. The fact is I´m dealing with extremelly large amount of records (from 5000 to 200 000, maybe more) and I have some questions here:

Q1) Are XML Data Islands handling FASTER than XML files? (I´m receiving 150 000 records from a SQLSERVER query into a XML file, then I transform that file into an element-based XML one and load into a AW via table.setURL(aUrl), and of course, I use the patch for paging).

Q2) Reading this forum I found an Alex´s workaround for SEARCH, I copy and paste but there are some bugs inside.

Bug:

The code seems (and explicit does) to search into a obj/rows/text and, ok, retrieve the correct result once.. BUT, the indexes remains unvariable

Ex.

[1][John]
[2][Peter]
[3][Paul]
[4][Andrea]
[5][Phil]

Those are the results when I search for P* text (P as first letter)

[2][Peter]
[3][Paul]
[5][Phil]

And I would like to get this:

[1][Peter]
[2][Paul]
[3][Phil]

The fact (and where I found like a bug) is that getting the indexes 2,3,5 as matching records from de first query makes the second query fails. If I repeat the same query (Text that begin with P) over the records resulting of first query (Peter, Paul, Phil).. the result of secod query should be exactly the same as first... BUT the result are:

[2][Peter]
[3][Paul]

The cause is that when Alex´s code find some value that matchs the criteria search, he put the index into an array, finally assigns those indexes to the property row of table.. And reset the count property to the length of rows found.
In the second search the code moves into de first COUNT-1 records and query the obj.getDataProperty in those indexes.. it would be: indexes 0,1,2.. in this particular case.. BUT, in this case the 3 elements resulting of the first query have the indexes: 2,3,5.. the bug is obvious.

What I did is to put the resulting indexes into a global array.. and do de search using those indexes.. and constantly reseting those indexes every time a search is made.

The code looks like this:

Note "extraIndexes" are the indexes resulting in continuos searchs.. Initially ordinal number from 0 to count-1

function doSearch(fieldType, fieldIndex, operator, criteria, errMsg){
var i;
//var maxx = obj.getRowProperty("count");
var maxx = extraIndexes.length;
rows = [];

var conditionMatch;

//alert(maxx + " es la poblacion");

if (fieldType == "int")
{
for (i=0; i<maxx; i++){
conditionMatch = eval("obj.getDataProperty('text', "+ extraIndexes[i] +", "+ fieldIndex +") " + operator + " " + criteria);
if (conditionMatch){
rows.push(extraIndexes[i]);
}
}
}
else
{
//too long, and it doesn´t matter
}

if (rows.length != 0){
extraIndexes = rows
obj.setRowProperty("count", rows.length);
//alert("Encontre "+rows.length+" registros, fijo esa cantidad");
obj.setRowProperty("values", rows);
obj.refresh();
goToPage(0);
}
else
{
alert(errMsg);
}
}


That WORKS! great... BUT...

Once I search and the results are show.. I CAN´T SORT THE GRID anymore.

Any idea Alex?

What I really want is to implement the search feature and once a search is made, sort properly the result. If is possible, I would like to reset the indexes everytime a search is made.. that would make things easy.. and will avoid the index handling.

Thanks in advance...

Raciel R.L.
February 9,

This topic is archived.

See also:


Back to support forum