<[EMAIL PROTECTED]> writes:

> 
> Hi Guys,
> This is harish working with verizon wireless.
> 
> can you help me in the following code snipplet.
> 
> var dsPreloadPtr = canvas.datasets.dspreload.getPointer();
>                                       dsPreloadPtr.setXPath
("dspreload:/preload/vendorList");
>                                       var nodeCount = 
dsPreloadPtr.getNodeCount();
>                                       Debug.write('nodeCount'+nodeCount);
>                                       var i=0;
>                                       while( i < nodeCount){
>                                                dsPreloadPtr.selectChild();
>                                                var comboVendorSeq = 
dsPreloadPtr.getNodeAttribute                                           
                                                        ('vendorSeq');
>                                                if(comboVendorSeq == 
vendorSeq ){
>                                                       dsPreloadPtr.deleteNode
(); break;
>                                                }
>                                                dsPreloadPtr.selectNext();
>                                                i++;
>                                       }
> 
> when i delete the record, on success i m running this loop.
> its giving the flash player error saying flashplayer is too slow. do you 
want to abort?
> 
> please let me know the solution.
> thx
> harish
> 
> The information contained in this message and any attachment may be
> proprietary, confidential, and privileged or subject to the work
> product doctrine and thus protected from disclosure.  If the reader
> of this message is not the intended recipient, or an employee or
> agent responsible for delivering this message to the intended
> recipient, you are hereby notified that any dissemination,
> distribution or copying of this communication is strictly prohibited.
> If you have received this communication in error, please notify me
> immediately by replying to this message and deleting it and all
> copies and backups thereof.  Thank you.
> 
> 


Harish,

The reference manual states that after a ptr.deleteNode() operation, the 
datapointer will either point to the next sibling or will be null if there are 
no more siblings. I am begining to suspect that this is not correct. 

This code reveals what is going on:

 var ncount=dpt.getNodeCount();
        for(var i=0;i<ncount;++i)
        {
          Debug.write("deleting nodes",dpt);
          dpt.deleteNode(); 
          // dpt now supposedly points to the next sibling   
        }  
        
Using a while loop with dpt.selectNext() does not work because the deleteNode 
moves the pointer to the next sibling and then the selectNext() moves the 
pointer to the next sibling after that. So you end up deleteing every other 
node.

Peter


Reply via email to