The QFileAsset Control
control is a great example of a complex control that combines many simpler controls to provide
a single, cohesive control that is very simple/straightfoward in terms of end-user usability.
and of course QFileControl
, the QFileAsset is an alternative to the standard
approach to handling file uploads on forms.
Moreover, while <input type="file">
requires a form to be submitted via a
(as opposed to a QAjaxAction
because the actual file upload mechanism is in a separate dialog box, this does allow you to have an entire form submitted via AJAX, while at the same time
the file upload, itself, is specifically performed using its own QServerControlAction within the QFileAsset
And finally, as this example shows, QFileAsset
allows you to process through the standard QForm
process (e.g. checking and reporting on failed "Required" constraints) in a way that makes sense,
and in a way that does not necessarily force the user to re-upload on every form submit.