如何在taglib中创建自定义是或否警告弹出框消息,同时删除grails中的行。
这是我的代码。
def submitDeleteButtonAttrs=['class':'delete', 'action':'delete','src':'../images/user_delete.png'
,'value':deleteLabel
,'formnovalidate':''
,'onclick':'return confirm('+deleteMessage+');' ]
def deleteButton=g.actionSubmitImage(submitDeleteButtonAttrs);
def searchTextHiddenFieldAttrs=['name':'searchText',
'value':searchTextValue]
def searchTextHiddenField=g.hiddenField(searchTextHiddenFieldAttrs);
def advSearchTextHiddenFieldAttrs=['name':'advancedSearchText',
'value':advancedSearchTextValue];
def advsearchTextHiddenField=g.hiddenField(advSearchTextHiddenFieldAttrs);
def searchCriteriaHiddenFieldAttrs=['name':'searchCriteria',
'value':searchCriteriaValue];
def searchCriteriaHiddenField=g.hiddenField(searchCriteriaHiddenFieldAttrs);
def operationAttrs=['name':'searchOperator','value':searchOperatorValue];
def operationSelectHiddenField= g.hiddenField(operationAttrs);
def uIDAttrs=['name':'id',
'value':subscriberForUID[0]];
def uidField=g.hiddenField(uIDAttrs);
htmlOutput <<"""<td class="${innerClassName}"><form method="post">${uidField} ${searchTextHiddenField} ${advsearchTextHiddenField} ${deleteButton}</form></td>"""
此代码中弹出窗口无法正常工作。
任何人都可以帮我解决上述代码中的错误。
答案 0 :(得分:0)
如果你不介意,我想建议使用twitter bootstrap的模式。放置两个按钮(取消按钮,删除按钮),点击后将params传递给控制器。 http://twitter.github.com/bootstrap/javascript.html#modals