NetTalk Central

Author Topic: Populating Browse from Memory table - embed point  (Read 4806 times)

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Populating Browse from Memory table - embed point
« 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!
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Populating Browse from Memory table - embed point
« Reply #1 on: January 20, 2012, 08:46:38 AM »
How about
Routines\Beginning of procedure\1. before opening files?
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Re: Populating Browse from Memory table - embed point
« Reply #2 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!
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

bruce2

  • Full Member
  • ***
  • Posts: 108
    • View Profile
    • Email
Re: Populating Browse from Memory table - embed point
« Reply #3 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?

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Re: Populating Browse from Memory table - embed point
« Reply #4 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!
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Populating Browse from Memory table - embed point
« Reply #5 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
 

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Re: Populating Browse from Memory table - embed point
« Reply #6 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.

« Last Edit: January 23, 2012, 01:00:49 AM by Johan van Zyl »
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Populating Browse from Memory table - embed point
« Reply #7 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

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Re: Populating Browse from Memory table - embed point
« Reply #8 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!
« Last Edit: January 23, 2012, 01:15:11 AM by Johan van Zyl »
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer