0
我有一個按鈕,更新標籤像字段集或TD顯示渲染模板:的Grails的形式更新TD
<td id="tdBtn"><g:submitToRemote name="showFieldSet" value="Edit" update="fieldSet" action="setPwdTxtVisible" onComplete="hideBtn(3)" /></td>
<fieldset id="fieldSet">
<-- this will be the section where the template will be rendered upon btn click name="showFieldSet" -->
</fieldset>
動作:
def setPwdTxtVisible=
{
def employeeId= params.employeeId
MySession session = MySession.getMySession(request, params.employeeId)
session.profileInstance.isEditPwd = true
render(template:"/layouts/passwordProfile")
}
有沒有辦法做到在def方法中而不是在按鈕中更新?問題是,當驗證失敗後,保存數據,頁面重新加載,更新的td再次回到沒有渲染模板。我想更新catch中的td(在SAVE方法中的try catch語句中),以便模板仍然存在。像這樣編碼:我如何訪問td在第一個不使用JavaScript的地方?這可能嗎?
def setPwdTxtVisible=
{
def employeeId= params.employeeId
MySession session = MySession.getMySession(request, params.employeeId)
session.profileInstance.isEditPwd = true
render(template:"/layouts/passwordProfile")
update fieldset //<<------
}