简体   繁体   English

JSF 1.1-无需页面刷新即可备份bean的调用操作方法(通过ajax / javascript)

[英]JSF 1.1-Calling action method of backing bean without page refresh(through ajax/javascript)

i am using JSF1.1. 我正在使用JSF1.1。 in my jsf application,i have a select dropdown and onChange of this dropdown i am calling a javascript function(changeCompany) which performs button click event(in below code snippet currCompany is the hidden command button) to fire action method of backing bean. 在我的jsf应用程序中,我有一个select下拉列表,并且该下拉列表的onChange我正在调用一个执行按钮单击事件的javascript函数(changeCompany)(在下面的代码片段currCompany中是隐藏的命令按钮)以触发支持bean的操作方法。 but by doing this, webpage is getting refresh because of this click event. 但是这样做会由于此click事件而刷新网页。 so i want to call action method of backing bean without page refresh(by javascript or ajax in JSF 1.1). 所以我想调用无需页面刷新的后备bean的操作方法(通过JSF 1.1中的javascript或ajax)。 i have to strictly use JSF1.1 with IE-8 and chrome-version 28. is there anyway to call action method of backing bean by javascript ? 我必须在IE-8和chrome-version 28上严格使用JSF1.1。是否有通过JavaScript调用支持bean的操作方法? how i can implement this using ajax(as per my knowledge jsf 1.1 has no/limited support for ajax (with IE8 and chrome-28))? 我如何使用ajax实现此功能(据我所知,jsf 1.1对ajax(使用IE8和chrome-28)没有/有限的支持)? Please suggest. 请提出建议。

 <h:selectOneMenu value="" id="currCompany" onchange="changeCompany();"> </h:selectOneMenu> function changeComapny() { document.getElementById("abc:xyz:currCountry").click(); } <h:commandButton value="" id="currCountry" action="#{BeanClass.ActionMethod}"/> 

I would recommand to see this previous post : Ajax with Jsf 1.1 implementation 我建议看到以前的这篇文章: 使用Jsf 1.1实现的Ajax

The best solution though would be to migrate to a newer version of JSF. 但是最好的解决方案是迁移到JSF的较新版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM