Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 32

Thread: Add grid to center of canvas section

  1. #11
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    I have

    select tweight, nweight, NPERLOSSATPIP,lnotes,calive,ldrilled,nveingrowth from deggweight where deggweight.cfk_dweight = {degg.cpk_degg}

    Where is the best place to call the refresh as the degg records change?

  2. #12
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,889
    Blog Entries
    18
    In the datachanged delegate or the afterrefresh delegate.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #13
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Hi Barry,

    The delegate of the control, the section it is on or the section with the parent data?

    David

  4. #14
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Hi Barry,

    I've tried this and when I use

    select tweight,nweight,nperlossatpip,lnotes,calive,ldrill ed,nveingrowth from deggweight where deggweight.cfk_dweight = {degg.cpk_degg}

    I get an empty treegrid.

    without the where clause it shows all records from deggweight


    I know I'm refreshing the grid as I have code in the parent section
    ////////////////////////////////////////////////////////////////
    // Event delegate for 'datachanged' event
    proc page1_EggData_datachanged()


    Lianja.getElementByID("page1.EggWeight.EggWeightGr id").caption = ttoc(datetime())
    Lianja.getElementByID("page1.EggWeight.EggWeightGr id").refresh()


    // insert your code here
    endproc

    Can you please tell me what I'm doing wrong in the where clause here.

    David

  5. #15
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,161
    deggweight.cfk_dweight = {degg.cpk_degg}

    Can you use that from the LAB Command Window and it works?

  6. #16
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    HI Hank,

    Thanks for posting that I see my mistake

    should be of course

    deggweight.cfk_degg = {degg.cpk_degg}

    Jumped out at me when I saw it in your post

  7. #17
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,161
    LOL

    It would have jumped out at you if you had tried running it from the Command Window also. That's why I didn't question what looked like a wrong reference. I didn't know that it was, but knew that if it was you'd find out.

  8. #18
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Still des not work though

    In the console if I use
    use degg in 0
    select degg
    select tweight, nweight, NPERLOSSATPIP,lnotes,calive,ldrilled,nveingrowth from deggweight where deggweight.cfk_degg = degg.cpk_degg


    I get a result set, albeit all of them not the juts for one egg

    If I try
    select tweight, nweight, NPERLOSSATPIP,lnotes,calive,ldrilled,nveingrowth from deggweight where deggweight.cfk_degg = {degg.cpk_degg}

    I get a data type mismatch error

    If I have it in the treegrid it shows no results

    If I use in the console
    lceggpk = degg.cpk_degg
    select tweight, nweight, NPERLOSSATPIP,lnotes,calive,ldrilled,nveingrowth from deggweight where deggweight.cfk_degg = lceggpk

    I get the correct result

    What is the LAB Command Window ?

    Looked in the docs but no result, so tried in the console, but I need to be referring the page really as it has one record for degg
    Last edited by avianmanagement; 2022-03-22 at 21:50.

  9. #19
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    IN the treegrid control if I use

    select tweight,nweight,nperlossatpip,lnotes,calive,ldrill ed,nveingrowth from deggweight where deggweight.cfk_dweight = degg.cpk_degg
    it shopws all the records for the match, but for all eggs

    If I use

    select tweight,nweight,nperlossatpip,lnotes,calive,ldrill ed,nveingrowth from deggweight where deggweight.cfk_dweight = {degg.cpk_degg}

    I get nothing. I've moved through every egg juts in case the one I was testing had not results, but none of them display any data

  10. #20
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,889
    Blog Entries
    18
    You can't use {macros} in the command window. They will only be ubstituted in the UI.

    What datatype is cpm_degg? It its character you need to enclose it in quotes.

    Just try this:

    select tweight, nweight, NPERLOSSATPIP,lnotes,calive,ldrilled,nveingrowth from deggweight where cfk_degg = "{degg.cpk_degg}"


    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us