Closed JanMikes closed 7 years ago
It's problem with https://api.nette.org/2.4/source-Forms.Container.php.html#44 => setDefaults is not called after submit and UploadControl needs default value for delete of previous image (I can write commit, which fix displaying image, but it don't solve main problem).
The solutions: 1) Create hidden text input with image name. 2) Use this:
// MyPresenter.php
public function actionEdit()
{
$this["myForm"]->setDefaults([
"image" => "xxx.jpg",
]);
$this["myForm"]->setValue('xxx.jpg');
}
Working example:
Example that does not work:
I am not sure if it is intended to not work (unable to make it work because of
$form->setDefaults()
implementation or it is just a bug.