Working with the Lianja Object Model
Lianja Apps are built out of pages. Pages are built out of sections. There are a wide variety of built-in sections. Form sections for example are made up of FormItems and Gadgets. So as we can see, a Lianja App consists of a hierarchy of visual elements. This hierarchy we will refer to as the Lianja Object Model (LOM).
You can consider the whole of the Lianja App Builder as a meta-framework that you can use to develop Apps with.
You can obtain a reference to the visual elements that make up your App using Lianja.getElementByID(item).
To get a reference to a page with the id mypage.
Oitem = Lianja.getElementByID("mypage")
To get a reference to a section with the id mysection contained within the page mypage.
Oitem = Lianja.getElementByID("mypage.mysection")
To get the current text in a FormItem with the id myitem in the section mysection contained within the page mypage use the following.
Oitem = Lianja.getElementByID("mypage.mysection.myitem") Cvalue = Oitem.value
Note: The synonyms Lianja.get(item) and Lianja.getObject(item) are also available.
Alternatively, use Lianja.item(position) to obtain a reference to the page at the specified position. This can be used with Lianja.count, which returns the total number of pages in the current App.
Pages and Sections also support the count property and the item() method, allowing you to traverse the complete LOM.
for i=1 to Lianja.count oPage = Lianja.item(i) ? oPage.id for j=1 to oPage.count oSection = oPage.item(j) ? oSection.id for k=1 to oSection.count oFormitem = oSection.item(k) ? oFormitem.id endfor endfor endfor