[xwiki-devs] Set Field Value in Velocity
OK, I think this one is going to be easy. I have searched but I cannot find a solution. I am trying to check if fields have values when the form is put in edit mode. If they don't have values, then I want to give it a value which is the name of the document. #if ($doc.getValue('processName').trim().length() == 0) #set($!processName="Bob") $!request.setParameter('processName', "Bob") #end I do not get an error, but "$doc.display('processName')" input box has nothing in it. P.S. In this code I just hard coded "Bob". After I get this working, I will change it to get the document name. -- View this message in context: http://xwiki.475771.n2.nabble.com/Set-Field-Value-in-Velocity-tp7589829.html Sent from the XWiki- Dev mailing list archive at Nabble.com.
Just one of those things where I needed to step away for a while. Once I came back, I solved it in 2 minutes. #if ($doc.getValue('processName').trim().length() == 0) $doc.set('processName', $doc.name) #end -- View this message in context: http://xwiki.475771.n2.nabble.com/Set-Field-Value-in-Velocity-tp7589829p7589... Sent from the XWiki- Dev mailing list archive at Nabble.com.
participants (1)
-
DeHaynes