Results 1 to 10 of 10

Thread: visiblewhen delegate

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

    visiblewhen delegate

    Canvas section
    Java script as language
    Desktop version of code live in Lianja when editing the code
    Beta 60

    Open code assistant and got visiblewhen delegate for an editbox

    Enter code of

    1 == 2

    whole code shows as below

    Item is still visible all the time when moving through records

    Any ideas what I'm still doing wrong

    function page1_dpref_field25_visiblewhen()
    {
    1 == 2
    // insert your code here
    };
    Last edited by avianmanagement; 2022-07-31 at 07:45.

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,889
    Blog Entries
    18
    Hi David

    The delegate is a function.

    you need to return the result of the expression.

    return <logical expression>
    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. #3
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    thnaks Barry

    I've tried this code in the visiblewhen of another editbox

    ////////////////////////////////////////////////////////////////
    // Event delegate for 'visiblewhen' event
    function page1_dpref_field34_visiblewhen()
    {
    return 1 == 2
    // insert your code here
    };

    It is always visible when I move through the records.
    Apply rules on change are set for the section

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,889
    Blog Entries
    18
    You need to switch into runtime view or view in browser,

    by the way, you can delete lines in the editor using Ctrl+D

    Dont forget to put ; at the end of javascript statements.

    return 1 == 2;
    Last edited by barrymavin; 2022-07-31 at 08:40.
    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

  5. #5
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Thank you

    Forgot about the runtime bit, working now but with another field for which I deleted the code visiblewhen code from the file


    If I have
    ////////////////////////////////////////////////////////////////
    // Event delegate for 'visiblewhen' event
    function page1_dpref_field34_visiblewhen()
    {
    return 1 == 2
    // insert your code here
    };

    it does not work

    Do I need to deploy or something in desktop to update the files ?
    Last edited by avianmanagement; 2022-07-31 at 08:50.

  6. #6
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    I'll start this clean tomorrow with a new test app

  7. #7
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    So that I'm testing this clean
    New database
    one table
    New app page, javascript language
    Page with canvas section
    textbox on canvas from chr column in table

    Open assistant
    set visiblewhen deligate to

    /// <reference path="../../library/Lianja.d.ts" />

    ////////////////////////////////////////////////////////////////
    // Event delegate for 'visiblewhen' event
    function page1_section1_field1_visiblewhen()
    {
    return 1 == 2;

    };

    section has apply rules on change ticked
    Run app

    textbox remains visible

    I have also tried

    return 1 == 2
    1 == 2
    1 == 2;

    Still remains visible

    Can someone tell me what I'm doing wrong please

  8. #8
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    If I deploy and run the web app it works.
    Run desktop app view version ( using the arrow button on top right ) then it does not

  9. #9
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,889
    Blog Entries
    18
    This has been fixed in beta61 available shortly.
    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

  10. #10
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Thanks Barry

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