【发布时间】:2014-01-20 00:13:57
【问题描述】:
我想在不刷新的情况下更改网页,但使用 ajax 来更改页面。
我想使用 primefaces,但是如果我使用 .load('mypfform.xhtml') 之类的 jquery 函数,如果我在其中放入一个 pf 组件,它就无法运行。
我怎么能做这样的事情?
【问题讨论】:
-
你到底想做什么?进一步解释
标签: jquery ajax primefaces load refresh
我想在不刷新的情况下更改网页,但使用 ajax 来更改页面。
我想使用 primefaces,但是如果我使用 .load('mypfform.xhtml') 之类的 jquery 函数,如果我在其中放入一个 pf 组件,它就无法运行。
我怎么能做这样的事情?
【问题讨论】:
标签: jquery ajax primefaces load refresh
您正在尝试浏览您的页面或尝试在任何时间间隔后刷新, 仅用于页面和数据刷新尝试
<p:poll interval="30" listener="#{bean.refresh}" update=":form:dataTable" />
导航试试
在 faces-config.xml 中
<navigation-rule>
<from-view-id>/signin.xhtml</from-view-id>
<navigation-case>
<from-action>#{login.submit()}</from-action>
<from-outcome>Success</from-outcome>
<to-view-id>/MainPage.xhtml</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-action>#{login.submit()}</from-action>
<from-outcome>fail</from-outcome>
<to-view-id>/signin.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
在哪里
@ManagedBean(name = "login", eager = true)
@SessionScoped
public class Login implements Serializable {
public String submit(){
//check for verification
if(isValid){
return "Success";
else{
return "fail";
}
}
【讨论】: