Grails g:链接按钮看起来比其他按钮大 [英] Grails g:link button appears larger than other buttons
问题描述
我有一个显示bookInstance细节的页面。在该页面上,我想放置一个使用ag:link的按钮来显示一些额外的细节。
我有机械地工作的代码,但按钮没有正确显示。按钮的框不缩小到内容的大小,并且按钮的右侧添加了一条有趣的线。
这是我目前的代码使用;
< g:form>
< p>< g:actionSubmit class =buttonaction =editvalue =$ {message(code:'default.button.edit.label',default:'Edit')} />
< g:hiddenField name =idvalue =$ {bookInstance?.id}/>< / p>
< / g:表格>
您正在将输入按钮封装在您的g:链接中。只需使用消息(形成按钮标签)作为g:链接内容即可。 是否需要定位标记或按钮?
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>
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?
这篇关于Grails g:链接按钮看起来比其他按钮大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!