Class YieldDeclaration
Defined in: yield.js.
Constructor Attributes | Constructor Name and Description |
---|---|
YieldDeclaration(parsingElement, contentAreaType)
The YieldDeclaration class holds the name of the yield-declaration (which is a place-holder for the contentFor-fields and is used in the layouts: content, header, footer, dialogs, .
|
Field Attributes | Field Name and Description |
---|---|
Get the value for property
name with the proper type
(as specified by nameType ). |
Method Attributes | Method Name and Description |
---|---|
Gets the type of the content area that this mmir.YieldDeclaration object refers to (i.e.
|
|
getEnd()
Gets the end position (index) of a mmir.YieldDeclaration object.
|
|
getName()
Gets the name of a mmir.YieldDeclaration object (e.g.
|
|
getStart()
Gets the start position (index) of a mmir.YieldDeclaration object.
|
Class Detail
YieldDeclaration(parsingElement, contentAreaType)
The YieldDeclaration class holds the name of the yield-declaration (which is a place-holder for the contentFor-fields and is used in the layouts: content, header, footer, dialogs, ...)
and its starting and ending position within the content-definition.
- Parameters:
- {Object} parsingElement
- with properties
name
{String},start
{Integer},end
{Integer} - {Integer} contentAreaType
- the type of the content area within the layout that this yield-declaration refers to (e.g. ViewConstants.CONTENT_AREA_BODY ) borrows the getValue function from ParsingResult:
- Requires:
- mmir.parser.ParsingResult#getValue
Field Detail
getValue
Get the value for property
but
name
with the proper type
(as specified by nameType
).
This may be neccessary, if the nameType is not e.g. STRING but a VARIABLE,
in which case name
does not reference the value itself, but the name
for the variable
This is a shortcut to the function
mobileDS.parser.ParsingResult.prototype.getValue
I.e. for YieldDeclration yield with a nameType of VARIABLE, to not use:
yield.getName()
yield.getValue(yield.getName(), yield.getNameType(), theRenderingData)
where theRenderingData is an object that contains a property from which the variable value can be retrieved, i.e.
where theRenderingData[yield.getName()] contains the YieldDeclaration's name.
Method Detail
{Integer}
getAreaType()
Gets the type of the content area that this mmir.YieldDeclaration object refers to (i.e. "areas" in the layout, e.g. bodyContents, dialogsContent).
- Returns:
- {Integer} Content area type (see mmir.Layout, e.g. ViewConstants.CONTENT_AREA_BODY)
{Integer}
getEnd()
Gets the end position (index) of a mmir.YieldDeclaration object.
- Returns:
- {Integer} End position of the Yield within the content (e.g. the bodyContent or the dialogsContent)
{String}
getName()
Gets the name of a mmir.YieldDeclaration object (e.g. content, header, footer, dialogs, ...).
- Returns:
- {String} Name - used by yield tags in layout
{Integer}
getStart()
Gets the start position (index) of a mmir.YieldDeclaration object.
- Returns:
- {Integer} Start position of the Yield within the content (e.g. the bodyContent or the dialogsContent)