OpenFaces 3 和 IE6(按钮操作)
我正在使用 OpenFaces,并且必须与 IE6 兼容。到目前为止,一切都或多或少地没有问题。
但是,我遇到了一个问题......
我在表单中有一些按钮。保存、添加、导出和删除。单击 Export 在 Firefox 和 IE8 中工作正常,定义的 bean 中的 exportToCsv() 被调用,因此它一定是浏览器行为。单击“使用 IE6 导出”会调用 bean 中的 add(),而不是 exportToCsv()。
有什么想法吗?
先感谢您。
I am using OpenFaces and have to be compatible with IE6. Up to now everything works more or less without problems.
However, I've run into a problem....
I've got a few buttons within a form. Save, Add, Export and Delete. Clicking on Export works fine with Firefox and IE8, exportToCsv() in the defined bean is invoked, so it must be a browser behaviour. Clicking on Export with IE6 invokes add() in the bean instead of exportToCsv().
Any idea?
Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
仅当您指定显示的按钮内容时,
组件才会呈现代替
事实是,后一种形式允许放置任意 HTML,因此需要
The
<o:commandButton>
component renders the<button>
tag instead of<input>
only if you specify the displayed button's content in between<o:commandButton>
and</o:commandButton>
. If you just need to display plain text, then you don't have to use this approach, and you can use the usualvalue
attribute, which will result in rendering<input>
tag instead of<button>
, i.e. use:instead of
The thing is that the latter form allows placing arbitrary HTML and thus requires the
<button>
tag.IE6 的
解决方案 1:使用
代替。
这可能是最明显的解决方案,但根据您的页面设计,这可能是一个问题,因为它不支持
解决方案 2:使用
IE6 has bugs with the
<button>
element. It does support it, but it doesn't send the value correctly.Solution 1: Use
<input type='button'>
instead.This is probably the most obvious solution, but depending on your page design, it may be a problem because it doesn't support nested elements the way
<button>
does.Solution 2: Use
<button>
but trigger the actions via Javascript (or more likely JQuery) rather than submitting the form directly, and use a technique such as having a hidden field that gets populated by JS according to which button is clicked, to ensure that the correct details get submitted.这绝对是 IE6 问题:
是时候找到解决方法了...
It's definitively a IE6 problem:
Time to find a workaround...
使用 OpenFaces 时的解决方法
从此源修改 CSS:
Workaround if using OpenFaces
Modified CSS from this source: