[TYPO3-mvc] Fluid Form Upload ViewHelper

Stefan Kruse besucher80 at gmx.de
Wed Feb 20 08:23:53 CET 2013


Hello,

i dont get it work. When I change the uplpoad field to textfield everything
works fine.

I want to upload and create picture objects. But it don't work. I only get
the error message : required property doesn't exist.

Has nobody an idea or a tipp? 

Regards Stefan




------------------------------

Message: 5
Date: Mon, 18 Feb 2013 10:11:35 +0100
From: "Stefan Kruse" <besucher80 at gmx.de>
Subject: [TYPO3-mvc] Fluid Form Upload ViewHelper
To: <typo3-project-typo3v4mvc at lists.typo3.org>
Message-ID:
	
<mailman.4309.1361178697.609.typo3-project-typo3v4mvc at lists.typo3.org>
Content-Type: text/plain;	charset="us-ascii"

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

                               

                }



------------------------------

_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc

End of TYPO3-project-typo3v4mvc Digest, Vol 49, Issue 24
********************************************************



More information about the TYPO3-project-typo3v4mvc mailing list