Ελεγχόμενα στοιχεία εισαγωγής XForms

Η διεπαφή χρήστη του XForms χρησιμοποιεί τα στοιχεία ελέγχου του XForms.

XForms στοιχεία ελέγχου

Τα στοιχεία διεπαφής χρήστη στο XForms ονομάζονται XForms στοιχεία ελέγχου

Τα πιο συχνά χρησιμοποιούμενα στοιχεία ελέγχου είναι τα <input> και τα <submit>.

Each control element has a ref attribute that refers back to the XForms data model.

Controls independent of the device

Understanding the XForms user interface does not precisely describe how XForms controls are displayed is important.

Since XForms is independent of platforms and devices, XForms leaves the right to display these spaces to the browser.

Therefore, XForms can be used on all types of devices, personal computers, mobile phones, handheld computers, etc. XForms is also the perfect solution for defining user interfaces for people with disabilities.

Input control

Input control is the most commonly used XForms control. It is used to input a line of text:

<input ref="name/fname">
<label>First Name</label>
</input>

Most of the time, the input control will be displayed as such an input field:

Εμφάνιση του στοιχείου input

Δοκιμάστε το خود σας

The <label> element

The <label> element is a mandatory child element of all XForms input controls.

The reason for this is to ensure that the form is usable on all types of devices (because labels can be processed in different ways.) For voice software, labels can be read out, and for some handheld devices, labels must follow the input screen by screen.

Secret control

Secret control is a special variant of the input space, designed for entering passwords or other hidden information:

<secret ref="name/password">
<label>Password:</label>
</secret>

Most of the time, the secret control will be displayed as such an input field:

Εμφάνιση του στοιχείου Secret

Textarea control

Textarea control is used for multi-line input:

<textarea ref="message">
<label>Message</label>
</textarea>

Textarea control can be displayed as such an input field:

Εμφάνιση του στοιχείου Textarea

Submit control

Submit control is used to submit data:

<submit submission="form1">
<label>Submit</label>
</submit>

Trigger control

Trigger control is used to trigger an action:

<trigger ref="calculate">
<label>Calculate!</label>
</trigger>

Output control:

Output space used to display XForms data:

<p>First Name: <output ref="name/fname" /></p>
<p>Last Name:  <output ref="name/lname" /></p>

Το παραπάνω παράδειγμα μπορεί να εμφανίσει μόνο το περιεχόμενο των κόμβων <fname> και <lname> του XForms XML εγγράφου (πρότυπο XForms):

<instance>
  <person>
    <name>
      <fname>David</fname>
      <lname>Smith</lname>
    </name>
  </person>
</instance>

Αποδίδεται ως εξής:

First Name: David
Last Name: Smith

Δοκιμάστε το خود σας

Control Upload

Το στοιχείο upload είναι σχεδιασμένο για να φορτώνει αρχεία στον διακομιστή:

<upload bind="name">
<label>Αρχείο για φόρτωση:</label>
<filename bind="file"/>
<mediatype bind="media"/>
</upload>