Results 1 to 2 of 2

Thread: [Answers] ShowDocument

  1. #1
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135

    [Answers] ShowDocument

    Code:
    // Event delegate for 'ready' event
    function page1_ready()
    {
            Lianja.showDocument("page:page1?action=add");
    }
    or

    Code:
    ////////////////////////////////////////////////////////////////
    // Event delegate for 'ready' event
    function page1_section1_ready()
    {
            Lianja.showDocument("page:page1?action=add");
    }
    Create new record whenever the section is loaded



    Sounds like you want to use the Stacked behavior Accordion I mentioned earlier or maybe you should have individual Pages. Remember you can change pages using Lianja.showdocument("page:ageid") and Lianja.showdocument("page:ageid?action=do_this").
    You can also
    set the Page Attribute to 'Hide page from menu' at runtime so users can't switch to it until you want them to.



    From Lianja v1.3, the "Full page edit" also applies to Add - clicking the Page's Add button or from an Add action:
    Code:
    Lianja.showDocument("page: page1?action=add")



    ​All topics in [Answers] alphabetically:http://www.lianja.com/community/show...ll=1#post12352
    Last edited by josipradnik; 2017-01-20 at 04:10.

  2. #2
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    Incredibly powerful, but possibly less well know, is the showdocument() function and the corresponding Lianja.showDocument() method.
    Here are some of the operations you can do with showdocument() and Lianja.showDocument():


    • Switch to another App
    • Switch to another Page
    • Navigate records: First, Previous, Next, Last, move relative, goto record number
    • Initiate data operations: Add, Edit, Delete
    • Search and filter data
    • Refresh 'Visible when' and 'Readonly when' Rules at Section or Page level
    • Change or reset UI States
    • Navigate to the previous or next Page
    • Hide or show the left and right Sidebars
    • Hide or show the Navigation Panel
    • Expand and collapse Sections
    • Select a particular Section in an accordion Page
    • Select a particular Tab in a TabView Section
    • Dynamically change Virtual Table queries




    Q:
    Is there an advantage to using Lianja.showDocument() method other than the ability to chain commands in a single call (which is very nice)? IOW, can all the same actions/settings be accessed using Lianja.get()? I ask because I seem to remember at one point that some things could only be done using showDocument.
    A:
    There are certainly some that are showdocument only - the hide/show of the navigation panel and sidebars and the UI States spring to mind.
    Others are standard
    section or pagemethods and will be calling the same code behind the scenes.



    there should be only one colon, if used, following the first name: that tells the Get method of Lianja which part of the hierarchy to start searching.

    So if section1 is on pgCreateTasks, your parameter to showDocument would be as below. Note that if you are starting at page level, the page: isn't needed.

    Code:
    Lianja.showDocument("page: pgCreateTasks.section1?action=add");



    Unlike Lianja.getElementByID(), Lianja.showDocument() needs to have a prefix of "section:" so that the specified action is performed against the section.



    Q:
    When using showdocument in a web browser, I can do a search on a section as follows.

    Code:
    Lianja.showDocument("page: page1.section3?action=search&text=King");

    This will search on my search field (which is lastname) for King.
    If I wanted to filter a section, what is the correct syntax?
    This is clearly not correct.
    Code:
    Lianja.showDocument("page: page1.section3?action=filter&text=lastname = 'King'");
    A:
    From the new treeview app .js file:

    Code:
    function page1_section1_dblclick(title, key)
    {
        Lianja.showDocument("page: page1.section4?action=search&text="+key);    
    };
    Code:
    Lianja.getElementByID("page1.section4").refresh();
    here is the OData syntax.

    Code:
    Lianja.showDocument("section:section2?action=filte r&text=contactname eq 'Jean Fresniere'"); 
    Lianja.showDocument("section:section2?action=filte r&text=contactname eq ''");


    ​All topics in [Answers] alphabetically:http://www.lianja.com/community/showthread.php?2717-Answers

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