local-host 2012-03-15 05:21 采纳率: 100%
浏览 48

Primefaces Ajax无法正常工作

I have a strange issue. I am developing an application on Jboss 7 using JSF, SEAM and Primefaces. Recently I had a strange problem. In my template I have two controls: 1. Categories 2. Channels

When a user clicks on a desired category, the block with channels is updated. If the user clicks on channel he goes to mysite.www/channel/idofchannel. On the first page everything works allright. But when the user is transfered to mysite.www/channel/idofchannel, the controls do not work. When I click on the category, the action of commandLink is executed, but does not update the block with channels. Does it have to do anything with f:viewParam?

Thanks

  • 写回答

1条回答 默认 最新

  • 衫裤跑路 2012-03-15 07:59
    关注

    Without your source code, I can only guess. If you are using p:commandLink then the reason might be, that it submits an ajax request by default. Then you have to use the update attribute to specify the components that will be updated by this ajax call.

    Here is an example from the Primefaces showcase:

    <p:commandLink id="ajax" update="panel,display" 
                actionListener="#{pprBean.savePerson}">  
        <h:outputText value="Ajax Submit" />  
    </p:commandLink>  
    

    Another option would be to set ajax=false and submit a full request:

    <p:commandLink id="nonAjax" actionListener="#{pprBean.savePerson}" style="margin-right:20px;" ajax="false">  
        <h:outputText value="Non-Ajax Submit" />  
    </p:commandLink>  
    
    评论

报告相同问题?

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题