[英]How is it possible to get all available java script methods of the component rich:modalPanel?
I have this rich:modalPanel in my xhtml page: 我的xhtml页面中有以下rich:modalPanel:
<rich:modalPanel id="submitPanel" width="100" height="100"
style="text-align:center;margin-top:30px;">
<h:graphicImage value="/img/ajax-loader.gif" style="border: 0;"
height="30" width="30" />
</rich:modalPanel>
Now i can call it in the onclick js attribute of the component h:commandLink for example: 现在,我可以在组件h:commandLink的onclick js属性中调用它,例如:
<h:commandLink styleClass="dontsave left" value="#{txt.cancel}"
action="#{newMessageBean.cancelAction}"
onclick="#{rich:component('submitPanel')}.show(); return true;" />
But how can i get all available js methods of the component rich:modalPanel? 但是,如何获取组件rich:modalPanel的所有可用js方法? The JBoss Documentation is not a good way, so it can be possible that i use an older richfaces version, which is not documented in a suitable way. JBoss文档不是一个好方法,因此我有可能使用较旧的richfaces版本,但没有以适当的方式对其进行记录。
How call i inspect these objects with all available methods on runtime? 我该如何调用运行时所有可用方法来检查这些对象? For example by using Firebug and the command "console.log(#{rich:component('submitPanel')})" or something else? 例如通过使用Firebug和命令“ console.log(#{rich:component('submitPanel')})”)或其他东西? What is the best way of solution? 最好的解决方法是什么?
You can call show modal panel like this: 您可以像这样调用显示模式面板:
<a4j:commandButton styleClass="button" value="#{msg.addNote}"
oncomplete="Richfaces.showModalPanel('noteDetails')">
</a4j:commandButton>
<rich:modalPanel id="noteDetails" />
<f:facet name="controls">
<h:graphicImage value="/images/close.png"
style="cursor:pointer" onclick="Richfaces.hideModalPanel('noteDetails')" />
</f:facet>
</rich:modalPanel>
Here is version with onclick
: 这是onclick
版本:
<a4j:commandButton value="Find Segments" immediate="true"
ajaxSingle="true"
oncomplete="Richfaces.showModalPanel('clientCatSearch')"
event="onclick" reRender="clientCatSearch">
</a4j:commandButton>
You need to know the full id of the component, eg j_id352:panel
. 您需要知道组件的完整ID,例如j_id352:panel
。 Then you can access the component with $('j_id352:panel').component
. 然后,您可以使用$('j_id352:panel').component
来访问$('j_id352:panel').component
。
You can't use #{rich:component('submitPanel')}
because the #{…}
only works for server-side processing, before the page is rendered. 您不能使用#{rich:component('submitPanel')}
因为#{…}
仅在呈现页面之前用于服务器端处理。
You should consider updating though, at least to RF 3.3.3 if you can't go to RF 4. 不过,如果您不能转到RF 4,则应考虑至少进行RF 3.3.3的更新。
You can inspect ModalPanel.prototype
object in Firebug. 您可以在Firebug中检查ModalPanel.prototype
对象。
A quick JavaScript snippet to output all members of ModalPanel.prototype
: 一个快速的JavaScript代码段,用于输出ModalPanel.prototype
所有成员:
var result = '';
for (var item in ModalPanel.prototype) {
result += item + '\n';
}
alert(result);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.