I'm seeing some strange behaviour when building 3 distinct rowsets in a single page. It appears that each rowset and its map methods is being called more times than there are records selected.

For example take the following code:

// ************************************************************ CREATE THUMBNAIL ROWSET ************************************************************ //

    write to console('images found=`records in selection([Images])`')

    $map := """
        imageURL:            `idp.utils.GetThumbnailURlForImage`;
        imageRecnum:        `record number([Images])`;
    """

    C_longint($rowSet)
$imageRowSet := RowSet.newFromSelection(->[Images];$map) ` Don't need callback

$noOfThumbnails := $imageRowSet->rowCount // used later and in javascript next/previous image

// *************************************************************** END CREATE ROWSET *************************************************************** //

// ************************************************************ CREATE CATALOGUE ROWSET ************************************************************ //

query([Catalogue Entry];[Catalogue Entry]PressMark; = ; [Items] Pressmark) // just get catalogue types

write to console('Cats found=`records in selection([Catalogue Entry])`')
    $mapII := """
            catShortRef:            `[Catalogue Entry]shortRef`;
catTransformedXML: `idp.utils.GetTransformedCatXMLBlob(->[Catalogue Entry] ShortRef;"select_cat_oo_header.xsl")`;
      """

    C_longint($CatRowSet)
$CatRowSet := RowSet.newFromSelection(->[Catalogue Entry]; $mapII) ` Don't need callback

// ************************************************************** END CATALOGUE ROWSET ************************************************************* //

// ************************************************************** CREATE BIBLIO ROWSET ************************************************************* //

query([BibRef];[BibRef]PressMark; = ; [Items]Pressmark) // get bibRef records

write to console('bibs found=`records in selection ([Bibliography])`')
    $mapIII := """
bibTransformedXML: `idp.utils.GetTransformedBiblioXMLBlob`
    """

    C_longint($bibRowSet)
$bibRowSet := RowSet.newFromSelection(->[Bibliography];$mapIII) ` Don't need callback

// **************************************************************** END BIBLIO ROWSET ************************************************************** //

Each of the map's methods have a write to console line just to track how many times they are called. What I see in the Active4D Console is as follows:

images found=2
GetThumbnailURlForImage
Cats found=1
GetTransformedCatXMLBlobCalled
bibs found=3
GetTransformedBiblioXMLBlobCalled
GetThumbnailURlForImageCalled
GetThumbnailURlForImageCalled
GetThumbnailURlForImageCalled
GetThumbnailURlForImageCalled
GetThumbnailURlForImageCalled
GetThumbnailURlForImageCalled
GetThumbnailURlForImageCalled
GetThumbnailURlForImageCalled
GetThumbnailURlForImageCalled
GetThumbnailURlForImageCalled
GetThumbnailURlForImageCalled
GetTransformedCatXMLBlobCalled
GetTransformedCatXMLBlobCalled
GetTransformedBiblioXMLBlobCalled
GetTransformedBiblioXMLBlobCalled
GetTransformedBiblioXMLBlobCalled
GetTransformedBiblioXMLBlobCalled
GetThumbnailURlForImageCalled
GetThumbnailURlForImageCalled

So despite only 2 image records being loaded, the image map method gets called 13 times. Catalogue Entry gets called 3 times but for only 1 record. Bibliography gets called 5 times for 3 records.

if I change rowset to build with Cached selection then the figures change again but are still incorrect.

What is going on here? Can I not create multiple rowsets in a single page or am I doing something wrong. Any advice gratefully received!

Regards, Michael.

A4D v4.0.0.0 rc3, 4D 2004.2, Mac OS X 10.4.2
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to