NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Johan van Zyl on January 20, 2012, 06:10:10 AM

Title: Populating Browse from Memory table - embed point
Post by: Johan van Zyl on January 20, 2012, 06:10:10 AM
Hi

Which embed point to use when I want to populate a WebBrowse from Memory table. All the embed points I have tried - the code executes every time I click anywhere on the browse!

Thx!
Title: Re: Populating Browse from Memory table - embed point
Post by: terryd on January 20, 2012, 08:46:38 AM
How about
Routines\Beginning of procedure\1. before opening files?
Title: Re: Populating Browse from Memory table - embed point
Post by: Johan van Zyl on January 20, 2012, 08:59:28 AM
Nope - tried After Opening Files as well - does not work!
p_web._trace shows nothing!
Code in Beginning of Procedure get executed - but also every time I click in browse.

Thx!
Title: Re: Populating Browse from Memory table - embed point
Post by: bruce2 on January 20, 2012, 11:53:49 AM
Top of generateBrowse routine.
But do you really want to populate the immem table for each browse page?
Title: Re: Populating Browse from Memory table - embed point
Post by: Johan van Zyl on January 22, 2012, 11:11:39 PM
But do you really want to populate the immem table for each browse page?
Sorry, I don't understand - please elaborate.

Thx!
Title: Re: Populating Browse from Memory table - embed point
Post by: Bruce on January 23, 2012, 12:50:28 AM
perhaps we need to go back to your original question;

>> Which embed point to use when I want to populate a WebBrowse from Memory table.

none. Browses populate from tables, InMemory tables are no different to any other table.

Which makes me think you're really asking something else... so perhaps word the question differently.

cheers
Bruce
 
Title: Re: Populating Browse from Memory table - embed point
Post by: Johan van Zyl on January 23, 2012, 12:53:17 AM
OK - what I meant was - where do I put my code to get data into my memory table?
Sorry question should have been - how do I populate the memory table- sorry!

Here is my current code:
FillMemory01 ROUTINE
    p_web._trace('callW TestingMemoryOptionsBrowse FillMemory01')
    loc:DateFrom = p_Web.GSV('loc:DateFrom')
    loc:DateTo = p_Web.GSV('loc:DateTo')
    
    Access:Memory01.Open()
    Access:Memory01.UseFile()
if records(Memory01) = 0! to prevent routine adding the same data over and over whenever I click anywhere on browse
    Access:LOG.Open()
    Access:Log.UseFile()
    PushBind
   !free(statsQ)
    BIND('LOG:LogType',LOG:LogType)
    BIND('LOG:Taskype',LOG:TaskType)
    open(ViewLOG01)
    buffer(ViewLOG01,120)
   ! set order
    ViewLOG01{PROP:Order} = 'LOG:LogType,LOG:Taskype'
   ! set filter
     ViewLOG01{PROP:Filter} = 'LOG:LogType = ''WalkIn'''
    set(ViewLOG01)
    next(ViewLOG01)
    set(ViewLOG01)
    loop
        next(ViewLOG01)
        !if errorcode();stop(errorcode()&' '&error());end
        if errorcode() then break.
        M01:C01 = LOG:TaskType
        M01:L01 = LOG:LogNumber
        Access:Memory01.Insert()
    end
    Access:Memory01.Close()
    close(ViewLOG01)
    UNBIND('LOG:LogType')
    UNBIND('LOG:Taskype')
    PopBind
!   LOC:EndTime=clock()
!   LOC:SecondsElapsed = (LOC:EndTime - LOC:StartTime)/100
    display  
END

This could become a large and complex bit of code involving many tables - therefor I'm using a view.

Title: Re: Populating Browse from Memory table - embed point
Post by: Bruce on January 23, 2012, 01:00:24 AM
Firstly, make a separate procedure to populate the table. Then you can call that procedure from lots of various places.

Frankly I see nothing in that code that suggests you should be browsing from a memory table - it looks like you just want a browse on the LOG table.

Also you have not made your memory table "User Specific" - surely it needs some sort of Session Value field in there, so the table can differentiate one user from another?

Lastly if you want to re-load the memory table for every change in dates, then you should call the memory loading procedure mentioned at the beginning, when the dates change.

Cheers
Bruce
Title: Re: Populating Browse from Memory table - embed point
Post by: Johan van Zyl on January 23, 2012, 01:13:26 AM
I added this line later:
This could become a large and complex bit of code involving many tables - therefor I'm using a view.
Maybe you missed that - but that is why I use a view and memory tables.
This was just me testing NTWS, NetWebBrowse, Memory tables etc.

Thx!