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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ListsAttributeLogical anddisplayattributesOnDrawItemDescription has an sqlLookup attribute that works in the same way as for .For a description, see the section “ Logical and Display Values.”Name of a server-side callback method in the <strong>Zen</strong> page class. This method returns the HTMLto display within the cell for the given item. This is the place to escape special characters ormake other last-minute adjustments to the HTML before displaying it.<strong>Zen</strong> invokes this method when it first draws the list box, automatically passing it the followingparameters:• %ResultSet — the result set from OnCreateResultSet, if this uses a resultset to generate its content• %String — the logical value for the item• %String — the display value for the itemThe callback must return a %String that contains the resulting HTML. The following exampleshows a valid method signature:Method DrawItem(pRS As %ResultSet,pValue As %String,pText As %String) As %String{Set tx=pTextSet tx=$REPLACE(tx,"&amp;eacute;",$ZCVT($CHAR(233),"O","HTML"))Set tx=$REPLACE(tx,"&amp;ntilde;",$ZCVT($CHAR(241),"O","HTML"))Quit tx}To use the above method as the callback, the developer would set OnDrawItem="DrawItem"for the .itemCount(Read-only) Number of options within the list. This is calculated when the query for thiscomponent is run. It has no value until the list is displayed.5.7.4 The <strong>Zen</strong> provides a text field with a drop-down list below it:Unlike some other controls described in this chapter, the <strong>Zen</strong> control is not a wrapper around HTML .The <strong>Zen</strong> is implemented using HTML primitives. This allows the to provide functionality notavailable with HTML , including:• The ability to edit values in the text box• Greater control over the contents of the list<strong>Using</strong> <strong>Zen</strong> <strong>Components</strong> 123

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

Saved successfully!

Ooh no, something went wrong!