输入中的挂毯形式类型=图像不起作用
我正在尝试使用图像作为这样的提交按钮,
<input t:id="submitButton" t:type="image" type="image" src="images/h_logon_button.png"/>
但是当我渲染页面时,我收到此错误
Unable to resolve 'image' to a component class name.
如何使用图像来创建提交按钮。如果我使用 css,验证失败后图像就会消失。
有什么想法吗? 发射机
I am trying to use an image for a submit buttin like this
<input t:id="submitButton" t:type="image" type="image" src="images/h_logon_button.png"/>
but when i render the page, i get this error
Unable to resolve 'image' to a component class name.
How do I use an image to create the submit button. if I use css, the image disappears after validation fails.
Any ideas?
Tx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
CSS 会起作用。听起来好像另一个具有更高特异性的 CSS 规则应用于验证失败的按钮。只需检查按钮并查看哪个规则覆盖它即可。
您看到的错误是由于
t:type="image"
造成的。在这里,您告诉 Tapestry 您的输入应该是组件类型image
。您可以通过三种方式解决此问题:t:id="submitButton"
和t:type="image"
以便您的提交将只是一个普通的旧 html提交t:type="submit"
t:type="image"
并添加与您提供的 id 相关的组件,如 < code>@Component(id="submitButton") 私人提交提交按钮;CSS will work. It sounds like another CSS rule with higher specificity is applied to the button on failed validation. Just inspect the button and see which rule overwrites it.
The error you are seeing is due to the
t:type="image"
. Here you are telling tapestry that your input should be of component typeimage
. You can fix this in three ways:t:id="submitButton"
andt:type="image"
so that your submit will just be a plain old html submitt:type="submit"
t:type="image"
and add a component relating to your provided id like@Component(id="submitButton") private Submit submitButton;
Tapestry 有一个适合您情况的特定组件 ImageSubmit。
Tapestry has a specific component, ImageSubmit, for your situation.