weixin_33726318 2014-02-10 08:13 采纳率: 0%
浏览 54

JSF中未触发ajax事件

I can't get the Ajax event to fire and call the actionListener or make the second select one update itself. What am I missing?

<p:selectOneMenu value="#{player}"
                converter="playerConverter" id="playerList">
            <f:selectItem itemLabel="---" noSelectionOption="true" />
            <f:selectItems value="#{servicePlayer.allPlayers}"
             var="n"
             itemValue="#{n}"
             itemLabel="#{n.combinedName}"
             itemLabelEscaped="true"/>
              <p:ajax event="change" execute="@this" actionListener="#
{serviceHCP.getClubs(player) }" update="ClubMenu" />
                </p:selectOneMenu>

                    <h:outputText value="Klubb"></h:outputText>
                    <!--  h:outputText value="#{ serviceHCP.myClubList.size()}" / -->

                    <p:selectOneMenu id="ClubMenu" value="#{serviceHCP.myCurrentClub}" rendered="#{not empty serviceHCP.myClubList}"
                    converter="clubConverter">
                        <f:selectItems value="#{serviceHCP.myClubList}"
                         var="clb"
                         itemValue="#{clb}"
                         itemLabel="#{clb.name}"
                         itemLabelEscaped="true"/>
                    </p:selectOneMenu>
                    <h:outputText value="Serietyp"></h:outputText>
  • 写回答

1条回答 默认 最新

  • 喵-见缝插针 2014-02-10 08:22
    关注

    Very stupid misstake

    selectOneMenu ajax events

    it's not called actionListener it's called listener.

    wrong

    <p:ajax event="change" execute="@this" actionListener="#{serviceHCP.getClubs(player) }" update="ClubMenu" />
    

    correct

    <p:ajax event="change" execute="@this" listener="#
    {serviceHCP.getClubs(player) }" update="ClubMenu" />
    
    评论

报告相同问题?

悬赏问题

  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿