value
HTML
A value can be constructed from virtually any textual HTML element. E.g.
12345
<span>12345</span>
<!-- widget value -->
... or
This is a more verbose value
<p id="verbose_value">This is<br/>a more<br/>verbose<br/>value</p>
<!-- widget value -->
Javascript
There is no action on a value, so there is no need for any Javascript callback. However,
you can use Javascript to set the value.
E.g. the following Javascript function will set the value of the above example to
"Hello world""
function buttonActio(target)
{
var elem = document.getElementById("verbose_value");
elem.widget_set_text("Hello World!");
}
Click Here to test it.
widget_set_text(str)
This method has one parameter:
-
str: the text string to be set as the value.
widget_highlight(highlight)
This method has one parameter:
-
highlight: true if the value should be highlighted, false to clear the highlight.
CSS
The widgets also get assigned a default CSS class (if you have not already done so.)
The default class for values is "widget_value".
This class can be ommitted in your HTML... the system will automatically make it.
Or you can create your own CSS class. E.g. for a value, you could declare the value as so:
<span class="my_value">R34.50</span>
<!-- widget value -->
Then you will need to define your own CSS entry for this value, e.g.
.my_value {
text-align: center;
border: 1px solid #c0c0c0;
margin-left: 1px;
margin-right: 1px;
vertical-align: middle;
background-color: white;
}
Note also that specifying a class and then the CSS is optional. If you don't specify it, the system will
use the default CSS class, which provides the default look and feel.
More...
Documentation
Other widgets
|