【问题标题】:Load primefaces components and pages width ajax加载 primefaces 组件和页面宽度 ajax
【发布时间】:2014-01-20 00:13:57
【问题描述】:

我想在不刷新的情况下更改网页,但使用 ajax 来更改页面。

我想使用 primefaces,但是如果我使用 .load('mypfform.xhtml') 之类的 jquery 函数,如果我在其中放入一个 pf 组件,它就无法运行。

我怎么能做这样的事情?

【问题讨论】:

  • 你到底想做什么?进一步解释

标签: jquery ajax primefaces load refresh


【解决方案1】:

您正在尝试浏览您的页面或尝试在任何时间间隔后刷新, 仅用于页面和数据刷新尝试

<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";
    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-07-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-21
    相关资源
    最近更新 更多