NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Nick on November 11, 2013, 02:48:13 PM

Title: How to loop through netwebbrowse?
Post by: Nick on November 11, 2013, 02:48:13 PM
[note some posts in this thread have been edited, and others removed, to keep the thread short - bruce]

Hi,

How do I loop through all records in a netwebbrowse?
I want the actual records in the browse after being filtered.

When the user clicks on a button in the browse (other).
All the records that have been filtered and if possible in the order of the browse at that moment.
In other words: what you would see if you scroll from the first until the last record.

Thanks,
Nick
Title: Re: How to loop through netwebbrowse?
Post by: Nick on November 11, 2013, 11:27:20 PM
Hi Bruce,

When the user clicks on a button in the browse (other).
All the records that have been filtered and if possible in the order of the browse at that moment.
In other words: what you would see if you scroll from the first until the last record.

Cheers,
Nick
Title: Re: How to loop through netwebbrowse?
Post by: Nick on November 12, 2013, 07:17:10 AM
Hi Bruce,

tried this:

teller = 0
open(ThisView)
set(ThisView) 
loop
   next(ThisView)
   if errorcode() then break.
   teller += 1   
end
stop(teller)

gives me the total number of records no matter if they are filtered (by search locator) to just a couple of records.
Should I set the filters again myself? And the order? How?

Cheers,
Nick
Title: Re: How to loop through netwebbrowse?
Post by: Bruce on November 13, 2013, 06:07:48 AM
>> Should I set the filters again myself? And the order?

yes.

do OpenFilesB
open(ThisView)
ThisView{prop:order} = p_web.GetSessionValue('procedurename_CurrentOrder_' & loc:RandomBrowseId)
ThisView{prop:filter} = p_web.GetSessionValue('procedurename_CurrentFilter_' & loc:RandomBrowseId)
set(ThisView)
loop
   next(ThisView)
   if errorcode() then break.
   teller += 1  
end
stop(teller)
Title: Re: How to loop through netwebbrowse?
Post by: Bruce on November 18, 2013, 06:22:16 AM
[ note - this thread has been edited to keep it short. - bruce ]

For the above example  - you'll need build 7.29

I've tweaked the above suggested code to get the "CurrentFilter" instead of just the Filter.
The CurrentFilter is new in 7.29, and contains the filter _after_ the locator has been applied. The earlier suggestion (of 'filter') would use the filter _before_ the locator.
I've also added CurrentFilter session value to make the code simpler.

Cheers
Bruce