View Full Version : Using the showdocument() function and Lianja.showDocument() method

2016-04-22, 09:17
The Lianja.getElementByID(item) method and its (quicker to type) synonym Lianja.get(item) allow you to call methods and get and set properties of the visual elements in the Lianja Object Model (http://www.lianja.com/doc/index.php/Working_with_the_Lianja_Object_Model) (LOM) hierarchy, from App through Pages and Sections to Formitems, Gadgets and Columns.

Also 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

Read more on the Lianja wiki here. (http://www.lianja.com/doc/index.php/Using_the_showdocument()_function_and_Lianja.showD ocument()_method)

2016-04-22, 10:31
thanks for reminding us ..


2016-04-22, 11:42
Hi Yvonne,

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.

BTW: that's a fantastic piece of documentation. I notice many more commands/attributes than were there previously. Fantastic.



2016-04-22, 12:35
Hi Hank,

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 (http://www.lianja.com/doc/index.php/Section) or page (http://www.lianja.com/doc/index.php/PageBuilder) methods and will be calling the same code behind the scenes. It would be nice to add further equivalents in to the doc - at the moment I've just suggested alternatives where a particular action isn't available on all clients.

Re BTW: (thanks) - yes, there were some missing from the main SHOWDOCUMENT() wiki page (and my memory :)) and I've now redirected to the new guide for details on the commands and actions. Any omissions, further additions or expanded examples and equivalents will be added there.



2016-04-22, 13:24
Very, very helpful.

Thanks Yvonne!

2016-05-18, 13:24
Hi Yvonne,

It seems that the where and requery actions are only supported on Desktop. What are the options on mobile for these actions?



2016-05-18, 21:34
Hi Hank,

requery() is a method of the "section" object.

2016-05-18, 22:30
Yes. It's also an action for Lianja.showDocument.

But the wiki on showdocument says this action can only be used in desktop client apps.

I am hoping that the requery method on the section works in mobile. I haven't been able to test because the ODBC connection that works on desktop isn't working on the cloud server. I'll work on the latter tomorrow, and then see what happens when I call the section requery method on mobile.



2016-05-18, 22:50
Yes Web and Mobile use the same framework so requery() should be working fine.

I note that its not supported in showDocument() in the LianjaWebFramework and will correct that. Please submit a ticket.