【发布时间】:2021-02-21 14:49:53
【问题描述】:
我需要使用 wicketstuff 的 StatelessAjaxSubmitLink 但我找不到任何方法来自定义默认标签(“提交查询”)。该类不继承 setLabel() 方法。有没有办法解决这个问题?
【问题讨论】:
标签: label wicket wicketstuff
我需要使用 wicketstuff 的 StatelessAjaxSubmitLink 但我找不到任何方法来自定义默认标签(“提交查询”)。该类不继承 setLabel() 方法。有没有办法解决这个问题?
【问题讨论】:
标签: label wicket wicketstuff
我猜你正在寻找setBody。
更新
如果您使用带有 HTML 标签 <input type="submit"/> 的组件,那么您应该使用 value 属性来设置您想要的标签。在 Wicket 中使用 AttributeAppender:
yourLink.add(AttributeAppender.append("value", "foo bar"));
见https://ci.apache.org/projects/wicket/guide/7.x/single.html#_modifing_tag_attributes
【讨论】:
Expected close tag for '<input wicket:id="submitButton" type="submit" class="btn get-started-button">' Possible attempt to embed component(s) '<input wicket:id="submitButton" type="submit" class="btn get-started-button">' in the body of this component which discards its body