Results 1 to 8 of 8

Thread: Lianja.activepage in js

  1. #1
    Senior Member
    Join Date
    Jan 2014
    Posts
    284

    Lianja.activepage in js

    Hi guys

    As Lianja.activepage does not exist in js/web, what would be the best alternative to Lianja.activepage.id ?

    Sure there must be a way to know which page is active in js or should we just use a global memvar?

    Thanks in advance



    SpringBox
    Last edited by SpringBox; 2021-08-13 at 02:02.

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

    I have added that into the Lianja Web Framework in Lianja 6.3.

    In the meanwhile as a workaround in your javascript library:

    function getActivePage()
    {
    var page = Lianja.get(Lianja.App.currentpageid);
    return page;
    };
    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
    Jan 2014
    Posts
    284
    Thanks Barry

    Don't know what we've missed but can't get that to work

    Cheers

    Simon

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,458
    Blog Entries
    12
    Try it interactively in the web browser javascript console.

    If you canít get it to work replace Lianja.get() with Lianja.App.getPage() or wait until 6.3 is released.
    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
    Jan 2014
    Posts
    284
    Hi Barry

    Not exactly sure what you meant in last reply so tried them all.


    Tried Lianja.App.getPage(); interactively in the browser but

    LianjaHtmlClient.js?_v=6.2.1.909-1628931458913:4433 Uncaught TypeError: Cannot read property 'replace' of undefined
    at window.Lianja.Application.getPage (LianjaHtmlClient.js?_v=6.2.1.909-1628931458913:4433)
    at <anonymous>:1:12

    Also tried every version of the syntax we can think of in the js command window but it doesn't recognise the App part. We have tried :

    var page = Lianja.App.getPage();

    var page = Lianja.get("Lianja.App.getPage");

    var page = Lianja.get("Lianja.App").getPage();

    var page = Lianja.get("Lianja.App.getPage()");


    and even (which have to be wrong)

    var page = Lianja.App.getPage("Lianja.App.currentpageid");

    var page = Lianja.App.getPage("currentpageid");

    but all return false


    Any thoughts?

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,458
    Blog Entries
    12
    var page = Lianja.App.getPage( Lianja.App.currentpageid );
    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

  7. #7
    Senior Member
    Join Date
    Jan 2014
    Posts
    284
    Hi Barry

    When testing interactively in js command window

    var page = Lianja.App.getPage( Lianja.App.currentpageid );

    returns

    Sun Aug 15 14:13:04 2021
    **** Lianja JavaScript error ****
    Traceback (most recent call last):
    TypeError: Result of expression 'Lianja.App' [undefined] is not an object.

    and when testing in the VFP command window, returns

    Sun Aug 15 14:21:21 2021
    **** Lianja error ****
    var page = Lianja.App.getPage( Lianja.App.currentpageid )
    ^
    Property/Variable 'APP' not found


    and returns undefined when testing interactively in browser.

    Lianja does not recognise the App object for some reason.

    Not to worry, we have made a memvar based work around for now and it can wait until 6.3

    Cheers

    Simon

  8. #8
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,458
    Blog Entries
    12
    Yes. Itís an undocumented workaround in the web browser. Not a desktop workaround.
    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