[Grails] grails在上传form里面有时间控件,为什么在控制器里面读不出来值呢

zxsy007x 2013-07-12

create.gsp

  <g:uploadForm  action="save" >

      <fieldset class="form">

        <g:render template="form"/>

      </fieldset>

      <fieldset class="buttons">

        <g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" />

      </fieldset>

    </g:uploadForm>

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

 _form.gsp

 

<div class="fieldcontain ${hasErrors(bean: QM_NewsInstance, field: 'add_date', 'error')} required">

  <label for="add_date">

    <g:message code="QM_News.add_date.label" default="Adddate" />

    <span class="required-indicator">*</span>

  </label>

  <g:datePicker name="add_date" precision="day"  value="${QM_NewsInstance?.add_date}"  />

</div>

 

<div class="fieldcontain">

  <label for="type">

    File

  </label>

  <input type="file" id="upload" name="upload"/>

</div>

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

在控制器中获取add_date为空,求指点一下。

另外新建grails群327195023。一起讨论学习。

 

 

kwakhyok 2013-07-26
不建议用grails自带的datepicker. 推荐bootstrap里面的datepicker.

Global site tag (gtag.js) - Google Analytics