[TYPO3-mvc] Fluid Form Upload ViewHelper

Stefan Kruse besucher80 at gmx.de
Mon Feb 18 10:11:35 CET 2013


Hi, i dont know if this is the right list for fluid questions, but I try it.
J

 

I use the Fluid Form Upload ViewHelper. I set the enctype form my form to
multipart/form-data. Now I want to validate the upload field. I use the
notEmtpy Validator. But the errorClass is not set. I use Typo3 4.7 and Fluid
4.7.7. And theres no property error set like by the textfield or the others
from viewhelpers. Is this right? Have somebody an idea what this could be?
Or Is this a known issue?  Thanks Stefan

 

My code if somebody need it:

 

HTML:

 

<f:form action="savepicture" name="picture" object="{picture}" method="post"
enctype="multipart/form-data">

                <f:form.upload property="image" errorClass="inputError" />

                 <f:form.submit class="btn btn-large btn-primary"
name="submit" value="Hochladen" />

</f:form>

 

Model:

 

class Tx_Tl24_Domain_Model_Picture extends
Tx_Extbase_DomainObject_AbstractEntity {

 

                /**

                * The image file

                *

                * @var string

                * @validate NotEmpty

                */

                protected $image;

 

GETTER / SETTER FOR IMAGE

 

}

 

And the Actions:

 

/**

                * action showpictures

                *

                * @param Tx_Tl24_Domain_Model_Picture $picture

                * @dontvalidate $picture

                * @return void

                */

                public function
showpicturesAction(Tx_Tl24_Domain_Model_Picture $picture = NULL) {

                               

                               if($picture === NULL) {

                                               $picture =
$this->objectManager->create('Tx_Tl24_Domain_Model_Picture');

                               }                              

                               $this->view->assign('picture',$picture);

                               $currentPictures =
$this->pictureRepository->findByCompany($this->customer);

 
$this->view->assign('currentPictures',$currentPictures);


                               

                }

                

                /**

                * action savepicture

                *

                * @param Tx_Tl24_Domain_Model_Picture $picture

                * @return void

                */

                public function
savepictureAction(Tx_Tl24_Domain_Model_Picture $picture) {

                               

                               some stuff

                               

                }



More information about the TYPO3-project-typo3v4mvc mailing list