Grails g:link button appears larger than other buttons

痴心易碎 提交于 2019-12-13 04:51:34

问题


I have a page that shows details of a bookInstance. On that page I want to put a button that uses a g:link to show some additional details.

I've got code that works mechanically, but the button doesn't appear correctly. The button's box doesn't shrink to the size of the content and there's a funny line added to the right hand side of the button.

Here's the code I'm currently using;

<g:form>
    <p><g:actionSubmit class="button" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" />
    <g:actionSubmit class="button" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
    <g:link controller="ownedBook" action="list" params="['book.id': bookInstance?.id]" ><input class="button" value="${message(code: 'default.button.add.owner.label', default: 'Owned Copies')}" /></g:link>
    <g:hiddenField name="id" value="${bookInstance?.id}" /></p>
</g:form>

Image Link


回答1:


You are wrapping an input button in your g:link. Just use the message (that forms the button label) as the g:link contents.

Do you want and anchor tag, or a button?



来源:https://stackoverflow.com/questions/6003817/grails-glink-button-appears-larger-than-other-buttons

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