|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WWidget
eu.webtoolkit.jwt.WWebWidget
public abstract class WWebWidget
A base class for widgets with an HTML counterpart
All descendants of WWebWidget implement a widget which corresponds almost one-on-one with an HTML element. These widgets provide most capabilities of these HTML elements, but rarely make no attempt to do anything more.
WCompositeWidget| Constructor Summary | |
|---|---|
WWebWidget()
Construct a WebWidget with a given parent. |
|
WWebWidget(WContainerWidget parent)
Construct a WebWidget with a given parent. |
|
| Method Summary | |
|---|---|
void |
addStyleClass(java.lang.String styleClass,
boolean force)
Adds a CSS style class. |
void |
callJavaScriptMember(java.lang.String name,
java.lang.String args)
Calls a JavaScript member. |
protected void |
doJavaScript(java.lang.String javascript)
Executes the given JavaScript statements, possibly delayed until after the widget is rendered. |
protected void |
enableAjax()
Progresses to an Ajax-enabled widget. |
static WString |
escapeText(java.lang.CharSequence text)
Escape HTML control characters in the text, to display literally. |
static WString |
escapeText(java.lang.CharSequence text,
boolean newlinestoo)
Escape HTML control characters in the text, to display literally. |
static java.lang.String |
escapeText(java.lang.String text)
Escape HTML control characters in the text, to display literally. |
static java.lang.String |
escapeText(java.lang.String text,
boolean newlinestoo)
Escape HTML control characters in the text, to display literally. |
WWidget |
find(java.lang.String name)
Finds a descendend widget by name. |
java.lang.String |
getAttributeValue(java.lang.String name)
Returns an attribute value. |
java.util.List<WWidget> |
getChildren()
Returns contained widgets. |
java.util.EnumSet<Side> |
getClearSides()
Returns the sides that should remain empty. |
WCssDecorationStyle |
getDecorationStyle()
Returns the decoration style of this widget. |
Side |
getFloatSide()
Returns the CSS float side. |
WLength |
getHeight()
Returns the height. |
java.lang.String |
getId()
Returns the (unique) identifier for this object |
java.lang.String |
getJavaScriptMember(java.lang.String name)
Returns the value of a JavaScript member. |
WLength |
getLineHeight()
Returns the CSS line height for contained text. |
WLength |
getMargin(Side side)
Returns a CSS margin set. |
WLength |
getMaximumHeight()
Returns the maximum height. |
WLength |
getMaximumWidth()
Returns the maximum width. |
WLength |
getMinimumHeight()
Returns the minimum height. |
WLength |
getMinimumWidth()
Returns the minimum width. |
WLength |
getOffset(Side s)
Returns a CSS offset. |
PositionScheme |
getPositionScheme()
Returns the CSS position scheme. |
java.lang.String |
getStyleClass()
Returns the CSS style class. |
int |
getTabIndex()
Returns the tab index. |
WString |
getToolTip()
Returns the tooltip. |
AlignmentFlag |
getVerticalAlignment()
Returns the vertical alignment. |
WLength |
getVerticalAlignmentLength()
Returns the fixed vertical alignment that was set. |
WLength |
getWidth()
Returns the width. |
boolean |
isDisabled()
Returns whether the widget is set disabled. |
boolean |
isEnabled()
Returns whether the widget is enabled. |
boolean |
isHidden()
Returns whether the widget is set hidden. |
boolean |
isHiddenKeepsGeometry()
Returns whether the widget keeps its geometry when hidden. |
boolean |
isInline()
Returns whether the widget is displayed inline or as block. |
boolean |
isLoaded()
Returns whether this widget has been loaded. |
boolean |
isPopup()
Returns whether the widget is overlayed. |
boolean |
isRendered()
Returns whether the widget is rendered. |
static java.lang.String |
jsStringLiteral(java.lang.String value)
Turn a UTF8 encoded string into a JavaScript string literal. |
static java.lang.String |
jsStringLiteral(java.lang.String value,
char delimiter)
Turn a UTF8 encoded string into a JavaScript string literal. |
void |
load()
Loads content just before the widget is used. |
protected void |
propagateSetEnabled(boolean enabled)
Propagates that a widget was enabled or disabled through children. |
void |
refresh()
Refresh the widget. |
void |
remove()
Destructor. |
static boolean |
removeScript(java.lang.CharSequence text)
Remove tags/attributes from text that are not passive. |
void |
removeStyleClass(java.lang.String styleClass,
boolean force)
Removes a CSS style class. |
void |
resize(WLength width,
WLength height)
Resizes the widget. |
void |
setAttributeValue(java.lang.String name,
java.lang.String value)
Sets an attribute value. |
void |
setClearSides(java.util.EnumSet<Side> sides)
Sets the sides that should be cleared of floats. |
void |
setDecorationStyle(WCssDecorationStyle style)
Sets a CSS decoration style. |
void |
setDisabled(boolean disabled)
Sets whether the widget is disabled. |
void |
setFloatSide(Side s)
Specifies a CSS float side. |
void |
setHidden(boolean hidden)
Sets whether the widget is hidden. |
void |
setHiddenKeepsGeometry(boolean enabled)
Sets whether the widget keeps its geometry when hidden. |
void |
setId(java.lang.String id)
Sets the CSS Id. |
void |
setInline(boolean inl)
Sets whether the widget is displayed inline or as a block. |
void |
setJavaScriptMember(java.lang.String name,
java.lang.String value)
Sets a JavaScript member. |
void |
setLineHeight(WLength height)
Sets the CSS line height for contained text. |
void |
setLoadLaterWhenInvisible(boolean how)
Change the way the widget is loaded when invisible. |
void |
setMargin(WLength margin,
java.util.EnumSet<Side> sides)
Sets CSS margins around the widget. |
void |
setMaximumSize(WLength width,
WLength height)
Sets a maximum size. |
void |
setMinimumSize(WLength width,
WLength height)
Sets a minimum size. |
void |
setOffsets(WLength offset,
java.util.EnumSet<Side> sides)
Sets CSS offsets for a non-statically positioned widget. |
void |
setPopup(boolean popup)
Lets the widget overlay over other sibling widgets. |
void |
setPositionScheme(PositionScheme scheme)
Sets the CSS position scheme. |
void |
setSelectable(boolean selectable)
Sets as selectable. |
void |
setStyleClass(java.lang.String styleClass)
Sets (one or more) CSS style classes. |
void |
setTabIndex(int index)
Sets the tab index. |
void |
setToolTip(java.lang.CharSequence message)
Sets a tooltip. |
void |
setVerticalAlignment(AlignmentFlag alignment,
WLength length)
Sets the vertical alignment. |
protected void |
updateSignalConnection(eu.webtoolkit.jwt.DomElement element,
AbstractEventSignal signal,
java.lang.String name,
boolean all)
|
| Methods inherited from class eu.webtoolkit.jwt.WWidget |
|---|
acceptDrops, acceptDrops, addStyleClass, boxBorder, boxPadding, disable, dropEvent, enable, getDrop, getJsRef, getParent, hasParent, hide, htmlText, layoutSizeChanged, positionAt, positionAt, removeStyleClass, resize, setClearSides, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setTabOrder, setVerticalAlignment, show, stopAcceptDrops, tr |
| Methods inherited from class eu.webtoolkit.jwt.WObject |
|---|
getObjectName, setObjectName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WWebWidget(WContainerWidget parent)
WWidget.WWidget(WContainerWidget parent)public WWebWidget()
Calls this((WContainerWidget)null)
| Method Detail |
|---|
public void remove()
WWidgetDeletes a widget and all children (recursively). If the widget is contained in another widget, it is removed first.
remove in class WWidgetWContainerWidget.removeWidget(WWidget widget)public void setPositionScheme(PositionScheme scheme)
WWidgetEstablishes how the widget must be layed-out relative to its siblings. The default position scheme is Static.
This applies to CSS-based layout.
setPositionScheme in class WWidgetPositionScheme,
WWidget.getPositionScheme()public PositionScheme getPositionScheme()
WWidgetThis applies to CSS-based layout.
getPositionScheme in class WWidgetPositionScheme,
WWidget.setPositionScheme(PositionScheme scheme)
public void setOffsets(WLength offset,
java.util.EnumSet<Side> sides)
WWidget
The argument sides may be a combination of Left, Right, Top, and
Bottom.
This applies only to widgets that have a position scheme that is
Relative, Absolute, or Fixed, and has a slightly
different meaning for these three cases.
For a relatively positioned widget, an offset applies relative to the
position the widget would have when layed-out using a
Static position scheme. The widget may be
shifted to the left or right by specifying an offset to the
Left or Right). The widget may be
shifted vertically, by specifying an offset for the
Top or Bottom.
For an absolutely positioned widget, an offset specifies a distance of the corresponding side of the widget with respect to the corresponding side of the reference parent widget. Thus, setting all offsets to 0 result in a widget that spans the entire reference widget. The reference parent widget is the first ancestor widget that is a table cell, or a widget with a relative, absolute or fixed position scheme.
For an fixed positioned widget, an offset specifies a distance of the corresponding side of the widget with respect to the browser window, regardless of scrolling. Thus, setting all offsets to 0 result in a widget that spans the entire browser window.
This applies to CSS-based layout.
setOffsets in class WWidgetWWidget.getOffset(Side side)public WLength getOffset(Side s)
WWidgetThis applies to CSS-based layout.
getOffset in class WWidgetWWidget.setOffsets(WLength offset, EnumSet sides)
public void resize(WLength width,
WLength height)
WWidget
Specify a new size for this widget, by specifying width and height. By
default a widget has automatic width and height, see
WLength#isAuto().
This applies to CSS-based layout, and only
block widgets can be given a
size reliably.
When inserted in a layout manager, the widget may be informed about its
current size using setLayoutSizeAware(). If you have defined a "wtResize()"
JavaScript method for the widget, then this method will also be called.
operation.
resize in class WWidgetWWidget.getWidth(),
WWidget.getHeight()public WLength getWidth()
WWidget
Returns the width set for this widget. This is not a calculated width,
based on layout, but the width as specified with
resize().
This applies to CSS-based layout.
getWidth in class WWidgetWWidget.resize(WLength width, WLength height),
WWidget.getHeight()public WLength getHeight()
WWidget
Returns the height set for this widget. This is not a calculated height,
based on layout, but the height as specified previously with
resize().
This applies to CSS-based layout.
getHeight in class WWidgetWWidget.resize(WLength width, WLength height),
WWidget.getWidth()
public void setMinimumSize(WLength width,
WLength height)
WWidgetSpecify a minimum size for this widget. When the widget is managed using a layout manager, these sizes are also taken into account.
setMinimumSize in class WWidgetWWidget.resize(WLength width, WLength height),
WWidget.getMinimumWidth(),
WWidget.getMinimumHeight()public WLength getMinimumWidth()
WWidget
Returns the minimum width set for this widget with
setMinimumSize().
getMinimumWidth in class WWidgetWWidget.setMinimumSize(WLength width, WLength height),
WWidget.getMinimumHeight()public WLength getMinimumHeight()
WWidget
Returns the minmum height set for this widget with
setMinimumSize().
getMinimumHeight in class WWidgetWWidget.setMinimumSize(WLength width, WLength height),
WWidget.getMinimumWidth()
public void setMaximumSize(WLength width,
WLength height)
WWidgetSpecify a minimum size for this widget.
setMaximumSize in class WWidgetWWidget.resize(WLength width, WLength height),
WWidget.getMaximumWidth(),
WWidget.getMaximumHeight()public WLength getMaximumWidth()
WWidget
Returns the maximum width set for this widget with
setMaximumSize().
getMaximumWidth in class WWidgetWWidget.setMaximumSize(WLength width, WLength height),
WWidget.getMaximumHeight()public WLength getMaximumHeight()
WWidget
Returns the minmum height set for this widget with
setMaximumSize().
getMaximumHeight in class WWidgetWWidget.setMaximumSize(WLength width, WLength height),
WWidget.getMaximumWidth()public void setLineHeight(WLength height)
WWidget
setLineHeight in class WWidgetpublic WLength getLineHeight()
WWidget
getLineHeight in class WWidgetpublic void setFloatSide(Side s)
WWidget
This only applies to widgets with a Static
getPositionScheme().
This lets the widget float to one of the sides of the parent widget, at
the current line. A typical use is to position images within text. Valid
values for Side or None , Left or
Right.
This applies to CSS-based layout.
setFloatSide in class WWidgetpublic Side getFloatSide()
WWidget
getFloatSide in class WWidgetWWidget.setFloatSide(Side s)public void setClearSides(java.util.EnumSet<Side> sides)
WWidget
This pushes the widget down until it is not surrounded by floats at the
sides (which may be a combination of Left
and Right.
This applies to CSS-based layout.
setClearSides in class WWidgetWWidget.setFloatSide(Side s)public java.util.EnumSet<Side> getClearSides()
WWidget
getClearSides in class WWidgetWWidget.setClearSides(EnumSet sides)
public void setMargin(WLength margin,
java.util.EnumSet<Side> sides)
WWidgetSetting margin has the effect of adding a distance between the widget and surrounding widgets. The default margin (with an automatic length) is zero.
Use any combination of Left, Right,
Bottom, or Top.
This applies to CSS-based layout.
setMargin in class WWidgetWWidget.getMargin(Side side)public WLength getMargin(Side side)
WWidgetThis applies to CSS-based layout.
getMargin in class WWidgetWWidget.setMargin(WLength margin, EnumSet sides)public void setHiddenKeepsGeometry(boolean enabled)
WWidgetNormally, a widget that is hidden will no longer occupy space, causing a reflow of sibling widgets. Using this method you may change this behavior to keep an (open) space when hidden.
Note: Currently you can only set this before initial rendering.
setHiddenKeepsGeometry in class WWidgetWWidget.setHidden(boolean hidden)public boolean isHiddenKeepsGeometry()
WWidget
isHiddenKeepsGeometry in class WWidgetWWidget.setHiddenKeepsGeometry(boolean enabled)public void setHidden(boolean hidden)
WWidget
Hides or show the widget (including all its descendant widgets).
setHidden(false) will show this widget and all descendant widgets that
are not hidden. A widget is only visible if it and all its ancestors in
the widget tree are visible, which may be checked using
isVisible().
setHidden in class WWidgetWWidget.hide(),
WWidget.show()public boolean isHidden()
WWidget
A widget that is not hidden may still be not visible when one of its
ancestor widgets is hidden. Use isVisible()
to check the visibility of a widget.
isHidden in class WWidgetWWidget.setHidden(boolean hidden),
WWidget.isVisible()public void setDisabled(boolean disabled)
WWidgetEnables or disables the widget (including all its descendant widgets). setDisabled(false) will enable this widget and all descendant widgets that are not disabled. A widget is only enabled if it and all its ancestors in the widget tree are disabled.
Typically, a disabled form widget will not allow changing the value, and disabled widgets will not react to mouse click events.
setDisabled in class WWidgetWWidget.disable(),
WWidget.enable()public boolean isDisabled()
WWidget
A widget that is not set disabled may still be disabled when one of its
ancestor widgets is set disabled. Use isEnabled() to find out whether a widget is enabled.
isDisabled in class WWidgetWWidget.setDisabled(boolean disabled),
WWidget.isEnabled()public boolean isEnabled()
WWidget
A widget is enabled if it is not disabled, and none of its ancestors are
disabled. This method returns whether the widget is rendered as enabled,
while isDisabled() returns whether a widget
has been explicitly disabled.
Note that a widget may be at the same time not enabled, and not disabled, in case one of its ancestors was disabled.
isEnabled in class WWidgetWWidget.isDisabled()public void setPopup(boolean popup)
WWidget
A widget that isPopup() will be rendered on top
of any other sibling widget contained within the same parent (including
other popup widgets previously added to the container).
This will only have an effect when the widgetis either
Absolute or Fixed getPositionScheme().
This applies to CSS-based layout, and configures the z-index property.
setPopup in class WWidgetpublic boolean isPopup()
WWidgetThis applies to CSS-based layout.
isPopup in class WWidgetWWidget.setPopup(boolean popup)public void setInline(boolean inl)
WWidget
This option changes whether this widget must be rendered in line with
sibling widgets wrapping at the right edge of the parent container (like
text), or whether this widget must be rendered as a rectangular block
that stacks vertically with sibling widgets (unless a CSS float property
is applied). Depending on the widget type, the default value is inline
(such as for example for WText, or WPushButton), or block
(such as for example for a WContainerWidget).
This applies to CSS-based layout.
setInline in class WWidgetpublic boolean isInline()
WWidget
isInline in class WWidgetWWidget.setInline(boolean inlined)public void setDecorationStyle(WCssDecorationStyle style)
WWidget
This copies the style over its current
getDecorationStyle()
setDecorationStyle in class WWidgetpublic WCssDecorationStyle getDecorationStyle()
WWidgetThis groups all decorative aspects of the widget, which do not affect the widget layout (except for the border properties which may behave like extra margin around the widget).
When a decoration style has not been previously set, it returns a default decoration style object.
getDecorationStyle in class WWidgetWWidget.setDecorationStyle(WCssDecorationStyle style)public void setStyleClass(java.lang.String styleClass)
WWidgetYou may set one or more space separated style classes. CSS style class works in conjunction with style sheet, and provides a flexible way to provide many widgets the same markup.
Setting an empty string removes the style class(es).
setStyleClass in class WWidgetWApplication.getStyleSheet()public java.lang.String getStyleClass()
WWidget
getStyleClass in class WWidgetWWidget.setStyleClass(String styleClass)
public void addStyleClass(java.lang.String styleClass,
boolean force)
WWidget
When force = true, a JavaScript call will be
used to add the style class to the DOM element (if JavaScript is
available). This may be necessary when client-side JavaScript manipulates
the same style class.
addStyleClass in class WWidget
public void removeStyleClass(java.lang.String styleClass,
boolean force)
WWidget
When force = true, a JavaScript call will be
used to remove the style class from the DOM element (if JavaScript is
available). This may be necessary when client-side JavaScript manipulates
the same style class.
removeStyleClass in class WWidget
public void setVerticalAlignment(AlignmentFlag alignment,
WLength length)
WWidgetThis only applies to inline widgets, and determines how to position itself on the current line, with respect to sibling inline widgets.
This applies to CSS-based layout.
setVerticalAlignment in class WWidgetpublic AlignmentFlag getVerticalAlignment()
WWidgetThis applies to CSS-based layout.
getVerticalAlignment in class WWidgetWWidget.setVerticalAlignment(AlignmentFlag alignment, WLength
length)public WLength getVerticalAlignmentLength()
WWidgetThis applies to CSS-based layout.
getVerticalAlignmentLength in class WWidgetWWidget.setVerticalAlignment(AlignmentFlag alignment, WLength
length)public void setToolTip(java.lang.CharSequence message)
WWidgetThe tooltip is displayed when the cursor hovers over the widget.
setToolTip in class WWidgetpublic WString getToolTip()
WWidget
getToolTip in class WWidgetpublic void refresh()
WWidget
The refresh method is invoked when the locale is changed using
WApplication#setLocale() or
when the user hit the refresh button.
The widget must actualize its contents in response.
refresh in class WWidget
public void setAttributeValue(java.lang.String name,
java.lang.String value)
WWidgetAssociate an extra attribute with this widget, with the given value. This is only useful when processing dom nodes associated with widgets in custom JavaScript code.
setAttributeValue in class WWidgetJSlot,
WApplication.doJavaScript(String javascript, boolean afterLoaded)public java.lang.String getAttributeValue(java.lang.String name)
WWidget
getAttributeValue in class WWidgetWWidget.setAttributeValue(String name, String value)
public void setJavaScriptMember(java.lang.String name,
java.lang.String value)
WWidgetThis binds a JavaScript member, which is set as a JavaScript property to the DOM object that implements this widget. The value may be any JavaScript expression, including a function.
Members that start with "wt" are reserved for internal use. You
may define a member "wtResize(self, width, height)" method if
your widget needs active layout management. If defined, this method will
be used by layout managers and when doing
resize() to set the
size of the widget, instead of setting the CSS width and height
properties.
setJavaScriptMember in class WWidgetpublic java.lang.String getJavaScriptMember(java.lang.String name)
WWidget
getJavaScriptMember in class WWidgetWWidget.setJavaScriptMember(String name, String value)
public void callJavaScriptMember(java.lang.String name,
java.lang.String args)
WWidgetThis calls a JavaScript member.
callJavaScriptMember in class WWidgetWWidget.setJavaScriptMember(String name, String value)public void load()
WWidgetWhen the widget is inserted in the widget hierarchy, this method is called. Widgets that get inserted in the widget hierarchy will be rendered. Visible widgets are rendered immediately, and invisible widgets in the back-ground (or not for a plain HTML session). This method is called when the widget is directly or indirectly inserted into the widget tree.
The default implementation simply propagates the load signal to its children. You may want to override this method to delay loading of resource-intensive contents.
During the life-time of a widget, this method may be called multiple times, so you should make sure that you do a deferred initializiation only once.
load in class WWidgetpublic boolean isLoaded()
WWidget
isLoaded in class WWidgetWWidget.load()public void setTabIndex(int index)
WWidgetFor widgets that receive focus, focus is passed on to the next widget in the tabbing chain based on their tab index. When the user navigates through form widgets using the keyboard, widgets receive focus starting from the element with the lowest tab index to elements with the highest tab index.
A tab index only applies to widgets than can receive focus (which are
WFormWidget, WAnchor, WPushButton), but setting a
tab index on any other type of widget will propagate to its contained
form widgets.
Widgets with a same tab index will receive focus in the same order as they are inserted in the widget tree.
The default tab index is 0.
setTabIndex in class WWidgetpublic int getTabIndex()
WWidget
getTabIndex in class WWidgetWWidget.setTabIndex(int index)public void setId(java.lang.String id)
WWidgetSets a custom Id. Note that the Id must be unique across the whole widget tree, can only be set right after construction and cannot be changed. This is mostly useful for in tests using a test plan that manipulates DOM elements by Id.
By default, auto-generated id's are used.
setId in class WWidgetWObject.getId()public WWidget find(java.lang.String name)
WWidget
find in class WWidgetWObject.setObjectName(String name)public void setSelectable(boolean selectable)
WWidgetWhen a widget is made unselectable, a selection of text (or images) will not be visible (but may still be possible).
By default, the widget inherits this property from its parent, and this
property propagates to all children. The top level container (
WApplication#getRoot()) selectable by
default.
setSelectable in class WWidgetpublic java.lang.String getId()
WObject
For a WWidget, this corresponds to the id of the DOM element that represents the widget. This is not entirely
unique, since a WCompositeWidget shares the same id as its implementation.
By default, the id is auto-generated, unless a custom id is set for a widget using WWidget.setId(String). The
auto-generated id is created by concatenating WObject.getObjectName() with a unique number.
getId in class WObjectpublic void setLoadLaterWhenInvisible(boolean how)
By default, invisible widgets are loaded only after visible content. For tiny widgets this may lead to a performance loss, instead of the expected increase, because they require many more DOM manipulations to render, reducing the overall responsiveness of the application.
Therefore, this is disabled for some widgets like WImage, or
empty WContainerWidgets.
You may also want to disable deferred loading when JavaScript event handling expects the widget to be loaded.
Usually the default settings are fine, but you may want to change the behaviour.
WApplication.setTwoPhaseRenderingThreshold(int bytes)
public static WString escapeText(java.lang.CharSequence text,
boolean newlinestoo)
public static final WString escapeText(java.lang.CharSequence text)
Returns escapeText(text, false)
public static java.lang.String escapeText(java.lang.String text,
boolean newlinestoo)
public static final java.lang.String escapeText(java.lang.String text)
Returns escapeText(text, false)
public static boolean removeScript(java.lang.CharSequence text)
This removes tags and attributes from XHTML-formatted text that do not simply display something but may trigger scripting, and could have been injected by a malicious user for Cross-Site Scripting (XSS).
This method is used by the library to sanitize XHTML-formatted text set
in WText, but it may also be useful outside the library to
sanitize user content when direcly using JavaScript.
Modifies the text if needed. When the text is not proper
XML, returns false.
public static java.lang.String jsStringLiteral(java.lang.String value,
char delimiter)
The delimiter may be a single or double quote.
public static final java.lang.String jsStringLiteral(java.lang.String value)
Returns jsStringLiteral(value, '\'')
public java.util.List<WWidget> getChildren()
WContainerWidget.addWidget(WWidget widget)public boolean isRendered()
WWidget
isRendered in class WWidgetWWidget.getJsRef()protected void propagateSetEnabled(boolean enabled)
WWidget
When enabling or disabling a widget, you usually also want to disable
contained children. This method is called by
setDisabled() to propagate
its state to all children.
You may want to reimplement this method if they wish to render differently when a widget is disabled. The default implementation will propagate the signal to all children.
propagateSetEnabled in class WWidgetprotected void enableAjax()
WWidgetThis method is called when the progressive bootstrap method is used, and support for AJAX has been detected. The default behavior will upgrade the widget's event handling to use AJAX instead of full page reloads, and propagate the call to its children.
You may want to reimplement this method if you want to make changes to widget when AJAX is enabled. You should always call the base implementation.
enableAjax in class WWidgetWApplication.enableAjax()protected void doJavaScript(java.lang.String javascript)
Calling
WApplication#doJavaScript() with JavaScript code that refers to a widget
that is still to be rendered causes JavaScript errors. This happens for
example when an object is created, but not yet inserted in the widget
tree.
This method offers an alternative: it queues up all doJavaScript calls for widgets that were not yet rendered until they are rendered.
protected void updateSignalConnection(eu.webtoolkit.jwt.DomElement element,
AbstractEventSignal signal,
java.lang.String name,
boolean all)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||