Servis-Rhino 4211B Guia do Utilizador Página 150

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 298
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 149
/// code here
});
Experience shows that the values can be:
"incomplete" – Missing required field not entered.
"error" – Data in one or more fields is invalid.
"" – This indicates that the form is valid.
It is important the form widgets startup() method is executed only after all the children widgets
contained within the form have been initialized.
The property called "value" will return an object with the current values of the fields in the form.
Remember that it is the "name" property of a form element that is the identity of the field and not
the "id" property.
eg.
var myValues = myForm.get("value");
See also:
Dojo Docs – dijit/form/Form – 1.9
dijit/form/Button
The Dojo Form widget called Button displays a button on the page. A button can be created in
code with the following:
var myButton = new Button({
label: "clickMe",
onClick: function() {
...
}
}, "<html ID>");
Its basic declarative markup looks like:
<button data-dojo-type="dijit/form/Button" type="button">Button</button>
When shown, it looks like:
When the button is pressed, an onClick event is generated. This can cause the execution of a
callback function:
<script>
function callBack1()
{
console.debug("Callback called");
}
</script>
<button dojoType="dijit.form.Button"
onClick="callBack1"
label="Button"></button>
A button can also show an icon with it. The icon is specified by naming a CSS class in the
iconClass parameter. For example:
<button dojoType="dijit.form.button" iconClass="myIcon"></button>
where there is a class definition that looks like:
.myIcon {
background-image:url("url to image");
width:25px;
height:25px;
Page 150
Vista de página 149
1 2 ... 145 146 147 148 149 150 151 152 153 154 155 ... 297 298

Comentários a estes Manuais

Sem comentários