12.07.2015 Views

Using Zen Components - InterSystems Documentation

Using Zen Components - InterSystems Documentation

Using Zen Components - InterSystems Documentation

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Other <strong>Zen</strong> <strong>Components</strong>The content may not reference other <strong>Zen</strong> components. However, it may contain <strong>Zen</strong> #()# runtime expressions.• Define a server-side OnDrawContent callback method that writes HTML content. If you define such a method, andreference it from the element, this method is called whenever the component is displayed.The method itself would look something like this:Method GetHTMLContent(pSeed As %String) As %Status{&htmlQuit $$$OK}• If you work with the component programmatically, you will see that it has a content property, a string of HTMLstatements. An initial value of the content can be set by placing the desired HTML tags in between the and elements in XData Contents, or by referencing an OnDrawContent callback.Client code can change the value of the content property by resetting it from JavaScript. The following example usesthe JavaScript utility function zenSetProp() to do this:// get html contentzenSetProp('myContent','content','some new content');The component has the following attributes:Attribute<strong>Zen</strong> componentattributesDescription has the same general-purpose attributes as any <strong>Zen</strong> component. Fordescriptions, see these sections:• “Behavior” in the “<strong>Zen</strong> Component Concepts” chapter of <strong>Using</strong> <strong>Zen</strong>• “Component Style Attributes” in the “<strong>Zen</strong> Style” chapter of <strong>Using</strong> <strong>Zen</strong>OnDrawContentName of a server-side callback method in the <strong>Zen</strong> page class. This method providesHTML content using &html syntax or WRITE commands.<strong>Zen</strong> invokes this method whenever it draws the component, automaticallypassing it a %String that contains the component’s seed value. The callback mustreturn a %Status data type. The following is a valid method signature:Method DrawMe(pSeed As %String) As %StatusTo use the above method as the callback, the developer would setOnDrawContent="DrawMe" for the component.seedAllows you to pass some arbitrary value to the OnDrawContent callback.9.2 Framed ContentThe <strong>Zen</strong> component is a wrapper for the HTML element. It may display images or other content withina frame.240 <strong>Using</strong> <strong>Zen</strong> <strong>Components</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!