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.
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 §ion=mypage
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
clears a control by removing all children
- Parameters:
- {Banana.Control} control
Clears all ids in the page. Used by application during page transition.
- Parameters:
- control
gets content placeholder
- Returns:
- {Banana.PageTemplate}
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
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
Register all binded events to control
- Parameters:
- {Banana.Control|string} control
unregister events from control
- Parameters:
- {Banana.Control} 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
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
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)
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
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.
reference to application Default = Banana.Application
- Parameters:
- {Banana.Application} app