ui:fileUploadDeleteCheckbox
View as MarkdownRenders a checkbox that deletes an already uploaded file when the form is submitted.
<ui:form.root action="update" objectName="conference" object="{conference}">
<ui:field.root name="logo">
<f:if condition="{conference.logo}">
<label>
<ui:fileUploadDeleteCheckbox fileReference="{conference.logo}" />
Delete current logo
</label>
</f:if>
<ui:fileUpload.root name="logo">
<!-- ... -->
</ui:fileUpload.root>
</ui:field.root>
</ui:form.root>
It complements the FileUpload primitive, which handles files picked in the browser, for a FileReference that is already stored. The checkbox carries the same signed @delete value as TYPO3's <f:form.uploadDeleteCheckbox>.
Place it inside a ui:form.root whose objectName matches the name of the action argument, otherwise it throws an exception. property names the model property the file reference belongs to. Inside a ui:field.root it defaults to the name of the field.
Arguments
Permalink to heading "Arguments"| Name | Type | Description | Required | Default |
|---|---|---|---|---|
fileReference |
TYPO3\CMS\Extbase\Domain\Model\FileReference | The existing file reference to allow deleting. | Yes | - |
property |
string | The model property (or dot-path) the file reference belongs to. Inherited from a surrounding ui:field.root when omitted. |
No | - |
id |
string | The id attribute of the checkbox. | No | - |
class |
string | The class attribute of the checkbox. | No | - |