【发布时间】:2014-06-25 13:28:21
【问题描述】:
对 JSF j:commandButton 的操作、chrome 浏览器和 JSF 1.1 有疑问
点击下面的命令链接调用JavaScript函数
<h:dataTable>
<h:column>
<h:panelGroup rendered="#{expression which returns true}">
<f:verbatim rendered="#{someView.agentEdit}"> </f:verbatim>
<h:commandLink id= "editId" styleClass="commandLinkClass"rendered="#policyHistory.agentEdit}" onclick="return performPolicyHistoryAction('Edit', id);" value="Edit"/>
</h:panelGroup>
</h:column>
</h:dataTable>
通过上面的代码,我得到了链接,它能够调用 js 函数'performPolicyHistoryAction'
在js函数中
function performPolicyHistoryAction(cntrlValue, cntrlId){
DWREngine.setAsync(false);
if (cntrlValue == 'Edit') {
document.getElementById("someString:lnkViewOnlyrefresh").click();
}
}
和 someString:lnkViewOnlyrefresh 被声明为
<h:commandButton action="#{someBean.viewOnlyAction}"
id="lnkViewOnlyrefresh" value="refresh" styleClass="hide" title="refresh"></h:commandButton>
在 chrome 中,不调用 commandButton 的 action 方法。它在 IE 和 FF 中运行良好
注意:如果我将警报放在
【问题讨论】:
-
上面的代码在哪里?
-
对不起,因为我第一次在这里发布的代码放置不当,现在你可以看到代码:)
标签: javascript google-chrome jsf-1.1