J,

This is an interesting approach and if you don't mind, I'd like to  
see sample code on how to do this (mainly for learning purposes). I  
was not aware of this and it may just be something new to OL, but  
Bruce pointed out to me that I can use the bgcolor0 and bgcolor1  
attributes of the grid tag to do just what I want. It's very simple  
and MAYBE more efficient than your solution.

Regardless, if you don't mind, I'd like to see sample code of how to  
do what you're suggesting.

Thanks,
Daniel

On May 18, 2006, at 6:15 PM, J Crowley wrote:

> I had issues dealing with position() as well.
>
> Originally, there was getNodeOffset(), which is what would probably
> give you the results you're looking for, I gather, but that's
> deprecated for reasons having to do with performance issues.  The
> debugger says to use 'position()' as a replacement, but I don't think
> they do the same thing, exactly.
>
> A workaround I've been using goes something like:
>
> Create a datapointer to your data.  Get the number of the total tags
> for which you want to find the positions.  Cycle through the tags with
> a for() loop, adding an attrubute to the tag called "num" with a value
> corresponding to the iteration.  Then, just reference '@num' in an
> xpathQuery on the datapointer to get its number within the list.  If
> you need, I can give you a specific code example of how to do this.
>
> I tried about a billion things with 'position()' but never got it to
> work the way I needed, and eventually just used this instead.  I'm not
> sure what the performance cost of this method is, though, so caveat
> emptor.
>
> Hope this helps.
>
>
> -Josh

_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to