OpenFaces 3 和 IE6(按钮操作)

发布于 2024-11-08 22:52:42 字数 266 浏览 0 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

独自唱情﹋歌 2024-11-15 22:52:42

仅当您指定显示的按钮内容时, 组件才会呈现

<o:commandButton value="Submit"... /> 

代替

<o:commandButton ...>Submit</o:commandButton>

事实是,后一种形式允许放置任意 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 usual value attribute, which will result in rendering <input> tag instead of <button>, i.e. use:

<o:commandButton value="Submit"... /> 

instead of

<o:commandButton ...>Submit</o:commandButton>

The thing is that the latter form allows placing arbitrary HTML and thus requires the <button> tag.

指尖上的星空 2024-11-15 22:52:42

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.

梦醒灬来后我 2024-11-15 22:52:42

使用 OpenFaces 时的解决方法

<o:outputLink styleClass="linkButton" ...>

.linkButton {
    display: block;
    float: left;
    margin: 0 0 0 0;
    background-color: #f5f5f5;
    border: 1px solid #dedede;
    border-top: 1px solid #eee;
    border-left: 1px solid #eee;
    font-family: "Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
    text-decoration: none;
    font-weight: bold;
    color: #565656;
    cursor: pointer;
    padding: 2px 2px 2px 2px; /* Links */
}

从此源修改 CSS:

Workaround if using OpenFaces

<o:outputLink styleClass="linkButton" ...>

.linkButton {
    display: block;
    float: left;
    margin: 0 0 0 0;
    background-color: #f5f5f5;
    border: 1px solid #dedede;
    border-top: 1px solid #eee;
    border-left: 1px solid #eee;
    font-family: "Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
    text-decoration: none;
    font-weight: bold;
    color: #565656;
    cursor: pointer;
    padding: 2px 2px 2px 2px; /* Links */
}

Modified CSS from this source:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文