FontAwesome with Grails <g:actionSubmit

坚强是说给别人听的谎言 提交于 2019-12-01 18:36:06

Try passing the class name to remoteLink, which creates a link that uses Ajax to call a remote function and you can add your fontAwesome classes to it.

<g:remoteLink  class="btn icon-ok" action="index"  >
    click (without i tag)
</g:remoteLink>

or

<g:remoteLink  action="index" >
       <i class="btn icon-ok">click (with i tag) </i>
</g:remoteLink>

Both approaches should work.

Don't use actionSubmit, just use a <button> and provide the link/action properties like so:

<button type="submit" class="btn">
  <i class="..."></i> Update
</button>

here's a more detailed example

<button type="submit" class="btn btn-danger" name="_action_delete" value="Delete">
  <i class="..."></i> ${message(code: 'default.button.delete.label', default: 'Delete')}   
</button>

Note: actionSubmit passes the following input name/values for update, save and delete

name="_action_update" //update
name="_action_update" //save
name="_action_delete" //delete

so you would just need to do the same if you're app is dependent on them

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!