Index

Classes

Class

Methods

Class Banana.Page


Extends Banana.Controls.Panel.

Methods borrowed from class Banana.Controls.Panel:
getTagName
Methods borrowed from class Banana.UiControl:
addControl, addCss, addCssClass, getAttribute, getAttributes, getClientId, getCss, getCssClass, getDimensions, getHtml, getHtmlAttributes, getState, getStyle, getStyleProperty, hasCssClass, registerEvents, removeAttribute, removeCssClass, removeState, setAttribute, setClientId, setCss, setEnabled, setState, setStyle, setVisible, switchCssClass, triggerEvent, unregisterEvents
Methods borrowed from class Banana.Control:
applyToChildren, bind, clear, createComponents, findControl, generateUniqueId, getControls, getDomEventTypes, getFirstUiControl, getId, getPage, getParent, getProxy, hasBind, invalidateDisplay, onPreInvalidateContents, render, setId, setPage, setParent, unbind, unload, updateDisplay

Defined in: Page.js.

Class Detail
Banana.Page()

Creates a page component.

Page is responsible for

rendering its control collection, register events on controls, unregister events on controls, apply databinding on controls, removing controls from data/dom,

page should not be manually instantiated. Application is responsible for this.

example of a page:

   var mypage = Banana.Page.extend({});

point your url to &section=mypage

Method Detail
addDataSet(id, the)

Datasets are to centralize data storage of your controls You can either use stand alone datasets and manually assign them to your controls or add datasets to the page and let the page automatically handle the data.

Parameters:
{String} id
for the dataset
{Banana.Data.DataSet} the
dataset
clearControl(control)

clears a control by removing all children

Parameters:
{Banana.Control} control
clearIds(control)

Clears all ids in the page. Used by application during page transition.

Parameters:
control
{Banana.Application} getApplication()
Returns:
{Banana.Application}
{Banana.PageTemplate} getContentPlaceHolder()

gets content placeholder

Returns:
{Banana.PageTemplate}
getDataSet(string)
Parameters:
string
id of the dataset
Returns:
Banana.Data.DataSet
{Banana.PageTemplate} getPageTemplate()

gets content placeholder

Returns:
{Banana.PageTemplate}
hideLoader()

Hides loader

initializeControl(control, target)

initialize controls this method walks through all controls and sets the following things

clientId -> for all Banana.Controls parent -> parent control holding this control page -> reference to the page

Page also automatically binds controls to their datasets

Parameters:
{Banana.Control} control
{Banana.Control} target
control used to determine parent
initRender(control, target, place, wasRendering, parentRerendering)

initialize rendering process

Parameters:
{Banana.Control} control
{Banana.UiControl} target
{Banana.UiControl} place
optional replace control
{boolean} wasRendering
true if this control is already in a rerender phase
{boolean} parentRerendering
true when parent control is currently rerendering
isValid()

validates all controls

onWindowResize()
Parameters:
Banana.UiControl
recursiveRegisterEvents(control)

Register all binded events to control

Parameters:
{Banana.Control|string} control
recursiveUnRegisterEvents(control)

unregister events from control

Parameters:
{Banana.Control} control
recursiveUpdateDisplay(control)

Call updateDisplay on all controls in the hierarchy

Controls can perform post-render actions in this function. These will also be called on rerender.

As a side-effect, the isRendered-property of all controls will be set. This should happen in the #renderControl-function, but we don't have a recursive pass there.

Events are not registered yet in updateDisplay!

Parameters:
{Banana.Control|string} control
Control which is rendered
remove(keepDom, cb)

removes complete page plus all its controls/events/binds and dom data We traverse through child controls in a async operation. This is needed to prevent slow script running detects by various browsers

Parameters:
{boolean} keepDom
when true we dont remove the dom
cb
removeControl(bool)

completely removes a control from dom and data model

Parameters:
Banana.Control
bool
dont remove dom when true. this is an optimalisation. from the controls which are getting removed, the root items (the one user want to remove) should be treated differently. - parent control collection altered parent control collection stays call dom remove dont call dom remove (done in root)
removeDataSets()

removes all datasets from page

renderControl(control, target, place)

We render the control by fetching all html data from the control.

Parameters:
{Banana.Control|String} control
Control which should be rendered.
{Banana.Control} target
The target where the control should be rendered in.
{Banana.Control} place
(optional) If given we replace the old control html data with new data
rerender(control)

rerenders control

Parameters:
{Banana.Control} control
run(target)

Starting point to initialize new page render. The application is responsible for calling this method

Parameters:
{mixed} target
could be a string or object. in case of string we assume we have a dom id.
setApplication(app)

reference to application Default = Banana.Application

Parameters:
{Banana.Application} app
setContentPlaceHolder(ph)

sets content placeholder page

Parameters:
{Banana.PageTemplate} ph
setPageTemplate(ph)

sets content placeholder page

Parameters:
{Banana.PageTemplate} ph

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Dec 05 2012 22:02:03 GMT+0100 (CET)