Difference between revisions of "Inline Delegates"

From Lianjapedia
Jump to: navigation, search
(Created page with "All delegates can be specified as "inline commands" by prefixing them with a !. For example: <code lang="recital"> !Lianja.getElementByID("section1").hide() </code> The com...")
 
Line 4: Line 4:
  
 
<code lang="recital">
 
<code lang="recital">
!Lianja.getElementByID("section1").hide()
+
!Lianja.getElementByID("page1.section1").hide()
 
</code>
 
</code>
  

Revision as of 06:58, 10 February 2016

All delegates can be specified as "inline commands" by prefixing them with a !.

For example:

!Lianja.getElementByID("page1.section1").hide()

The command should be in the scripting language that you have specified for the UI component. This can be used with good effect in manipulating the Lianja Object Model (LOM) with minimum coding. If you prefix the delegate with a (jquery-style) $ rather than a ! character then this provides a shorthand way of calling Lianja.showDocument().

For example:

$("section:section1?action=hide")

Is the same as

Lianja.showDocument("section:section1?action=hide")

When calling Lianja.showDocument() or using "inline delegates", you can "chain" actions together using || to separate them.

For example:

$("page:customers.section1?action=search&text=value||hidedialogpanel")


This is very effective when used in "inline delegates" to perform more than one action that changes the state of the UI through a transition.