Hello,
Is this code not working?
The logic looks ok but I don't know what you're doing with these variables on the code so I don't know if it's okay or not.
The only thing that's confusing is that you're setting two different objects on $defaultUploadedFile, one is the uploadedFile that comes in the content object,and the second case the uploaded file from the browser.
Since I don't see the entire code I'm not sure how you're handling that later in the code.
Thanks
Maria
On Fri, Jun 15, 2012 at 3:38 AM, blumenr
<villeskantsb...@googlemail.com> wrote:
I have created a content structure with one file type field. On the
website (frontend) I prepared a form which allows the user to edit the
data of this content structure. If a user had uploaded an image
previously and does not choose an image (in a later edit), the image
shall not be removed from the content (structure). In case the user
chooses an image, the image shall be replaced, of course. How would my
velocity code look like in order to make this work? Currently, I have
the following approach:
#if($UtilMethods.isSet($oldAnswer))
#set($submitContentSrc = "/vtl/content_form_macro_override_edit.vtl")
#set($defaultAnswernumeric = $oldAnswer.answernumeric)
#set($defaultAnswertext = $oldAnswer.answertext)
#if($request.getParameter('uploadedFile') == "")
#set($defaultUploadedFile = $oldAnswer.uploadedFile)
#else
#set($defaultUploadedFile = $request.getParameter('uploadedFile'))
#end
#set($structureType = "Aduseranswers")
#set($theinode = $oldAnswer.inode)
#set($theidentifier = $oldAnswer.identifier)
#set($uid = $session.getAttribute("USER_ID"))
Thanks in advance!
--
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To view this discussion on the web visit https://groups.google.com/d/msg/dotcms/-/ApxNAgbzv9UJ.
To post to this group, send email to dot...@googlegroups.com.
To unsubscribe from this group, send email to dotcms+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dotcms?hl=en.
--
Community Manager
dotCMS
Main:
305.900.2001Fax:
305.397.2579www.dotcms.comhttp://www.twitter.com/dotCMS
http://www.facebook.com/dotCMShttp://www.twitter.com/mabouzaPlease consider the planet before printing this email.