title: g:formatDate as value on g:textField
body: <p>I have this <code>.gsp</code> file which uses the <code>JQuery.datetimepicker()</code> to a particular <code>&lt;g:textField &gt;</code>. When the <code>&lt;g:form&gt;</code> of the <code>&lt;g:textField&gt;</code> is submitted, I have to convert from <code>java.lang.String</code> to <code>java.util.Date</code> following the steps provided by <a href="http://www.roseindia.net/java/java-conversion/StringToDate.shtml" rel="nofollow">RoseIndia</a> to match with the property of the pertaining domain of the concerned controller.</p>
  
  <p>The problem is having to display the <code>java.util.Date</code> property of the domain back to <code>java.lang.String</code> to be displayed in the <code>&lt;g:textField&gt;</code> following to format of <code>JQuery.datetimepicker()</code>. I have tried to use <code>&lt;g:formateDate&gt;</code> which worked but I have to display the result back to the <code>&lt;g:textField&gt;</code> for me to use the <code>JQuery.datetimepicker()</code> to that particular field.</p>
  
  <p>The Javascript:</p>
  
  <pre><code>$("#datetime").datetimepicker({
    timeFormat: 'hh:mm:ss',
    dateFormat: 'dd-mm-yy'
  });
  </code></pre>
  
  <p>In the body:</p>
  
  <pre><code>&lt;!-- Error here which return a GrailsTagException --&gt;
  &lt;% println ${formatDate(format:"dd-MM-yyyy HH:mm:ss", date:"model?.createdDate")} %&gt;
  &lt;g:formatDate format="dd-MM-yyyy HH:mm:ss" date="${model?.createdDate}"/&gt;
  &lt;g:textField name="dateReported" id="datetime" value="${model?.createdDate}"/&gt;
  </code></pre>