|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defined in widgetsBasic.js
The LabelWidget is primarily the simplest possible usable widget. (This is also why methods I'd normally leave undocumented are documented here, for educational purposes.) It is simply a text span on the screen; due to the way HTML works and how simple this Widget is the text inside can not even be styled; the label widget is simply a <span> with a text node.) However, due to how hard/annoying the DOM makes it to have this sort of "label", I find myself using this in real code all the time, since it integrates so well with the rest of XBLinJS; trivial, yes, useless, no.
The widget does assume you aren't going to muck around with the insides directly; if you fragment the internal text node or do any other crazy DOM things, the value you retrieve from it will be wrong.
Relevant Parameters:
Inheritances:
The LabelWidget is a <span> that inherits everything ("*").
Field Summary | |
Object |
content
Defines the content of the LabelWidget, a <span> tag. |
Constructor Summary | |
LabelWidget
()
LabelWidget - simple demo widget showing constant text, surprisingly useful |
Method Summary | |
Object
|
get_value()
Retrieves the current text of the LabelWidget and returns it. |
void
|
set_value(val)
Sets the current value of the widget to the given text, removing any text that may currently be there. |
Field Detail |
Object content
Constructor Detail |
LabelWidget()
Method Detail |
Object get_value()
Note how it actually uses DOM functions to retrieve the text; this means no duplication of that value in memory. Normally I'd consider this silly, but this is good technique to show.
Note you should not call this directly; call widget.get("value"). This is documented for educational purposes, not use.
void set_value(val)
Note you should not call this directly; call widget.set("value", "your new text");. This is documented for educational purposes only, not use.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |