NetTalk Central

Author Topic: How to loop through netwebbrowse?  (Read 2528 times)

Nick

  • Full Member
  • ***
  • Posts: 118
    • View Profile
    • Email
How to loop through netwebbrowse?
« 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
« Last Edit: November 14, 2013, 12:18:53 AM by Bruce »

Nick

  • Full Member
  • ***
  • Posts: 118
    • View Profile
    • Email
Re: How to loop through netwebbrowse?
« Reply #1 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

Nick

  • Full Member
  • ***
  • Posts: 118
    • View Profile
    • Email
Re: How to loop through netwebbrowse?
« Reply #2 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11242
    • View Profile
Re: How to loop through netwebbrowse?
« Reply #3 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)
« Last Edit: November 18, 2013, 06:27:02 AM by Bruce »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11242
    • View Profile
Re: How to loop through netwebbrowse?
« Reply #4 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
« Last Edit: November 18, 2013, 06:28:22 AM by Bruce »