【问题标题】:Primefaces inside dynamic jsf fragment not working动态jsf片段中的Primefaces不起作用
【发布时间】:2013-05-16 19:09:27
【问题描述】:

我有一个动态呈现的 jsf 片段,它有一个日期元素,在选择时应该在我的请求范围 bean 中执行逻辑,但它永远不会触发。

当我从片段中取出元素时,它工作正常。

<p:calendar id="dob_calendar"
    value="#{registrationDetailsHandler.dateOfBirth}"
    showButtonPanel="true" navigator="true" yearRange="c-80:c+1"
    required="true" 
    requiredMessage="Date of Birth is Required"
    immediate="true">
    <p:ajax event="dateSelect" update="kid_panel"
        listener="#{registrationDetailsHandler.calculateAge()}"
        process="@this,firstName" />
</p:calendar>

【问题讨论】:

  • 尝试将您的托管范围更改为@ViewScoped。
  • 当我创建 @ViewScope 时,我的 ajax 都没有工作。这是复合材料。
  • 还有其他信息可以深入了解实际情况以找到问题吗?
  • 你的片段在哪里?
  • 以防万一!这是 h:form 吗?

标签: ajax jsf dynamic primefaces fragment


【解决方案1】:

尽量使用类名代替id,并使用jQuery选择器

例如

<h:panelGroup styleClass="kid_panel">

在你的动态块中

update="@(.kid_panel)" 或 process="@(.kid_panel)"

【讨论】:

    猜你喜欢
    • 2014-08-12
    • 2013-11-25
    • 1970-01-01
    • 1970-01-01
    • 2015-02-28
    • 2012-07-24
    • 2012-05-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多