This function allows you to call from within a FlexQuery expression any Stock-Section defined in the given template.
When called by this function, a Stock-Section is always executed in the Text Output formatting context independently on any formatting specified within the Stock-Section itself. So, everything the Stock-Section produces will be a plain text which is returned as the function result.
Note: During the call, the generator output status property
(see GOMOutputInfo.status
) will be "generating"
within both the stock-section itself and any template components called from it
(including any subtemplates).
This will be independent of what the main (context) generation phase currently is.
In any other respect, calling the Stock-Section using this function will be identical to call it via a template component (e.g. Call Stock-Section Section or Call Stock-Section Control).
You can use this feature to program the generation of small text fragments that you may need in your FlexQuery scripts. This allow you to use the Stock-Sections also as procedures enhancing FlexQuery scripts and in that way to utilize capabilities of template components.
For instance, this function may be especially useful when you need to generate a list of items which should be both represented by a richly formatted text and sorted accordingly to that text representation. To program this, you may define an Element/Attribute Iterator which generates those items so that each item is produced by a certain block of template components where you could define any rich content you need. Then, move this block into a Stock-Section and replace it in the iterator's body with the stock-section call (e.g. using Call Stock-Section section or control). Then, specify within the iterator's properties the sorting key expression which calls the same stock-section using this function.
Parameters:
element
Specifies the context element passes to the Stock-Section (see'stockSection.contextElement'
generator variable).If this parameter is not specified, the current generator context element will be used by default (see
GOMContext.contextElement
).When the parameter is specified and its value is
null
, the function returns an empty string.
stockSectionName
The name of the Stock-Section to call. (This should be the name under which the Stock-Section is defined in the template.)
param
params
If specified, provides one or several (in the form of Array) objects passed as parameters to the Stock-Section.The Stock-Section parameters can be accessed within the Stock-Section using the
'stockSection.params'
generator variable.
Tip:
You may call this function in a method-like style, e.g.:
methodElement.callStockSection("Method Header")
See Also:
checkStockSectionOutput(), Array(), 'stockSection'
generator variable.