JSF(Primefaces) ajax update of several elements by ID's

前端 未结 1 1059
误落风尘
误落风尘 2020-12-12 17:35

One more question concerning JSF.Particularly, Primefaces.
Have following problem with ajax update of elements by id\'s at same time. If elements on page goes one by on

相关标签:
1条回答
  • If the to-be-updated component is not inside the same NamingContainer component (ui:repeat, h:form, h:dataTable, etc), then you need to specify the "absolute" client ID. Prefix with : (the default NamingContainer separator character) to start from root.

    <p:ajax process="@this" update="count :subTotal"/>
    

    To be sure, check the client ID of the subTotal component in the generated HTML for the actual value. If it's inside for example a h:form as well, then it's prefixed with its client ID as well and you would need to fix it accordingly.

    <p:ajax process="@this" update="count :formId:subTotal"/>
    

    Space separation of IDs is more recommended as <f:ajax> doesn't support comma separation and starters would otherwise get confused.

    0 讨论(0)
提交回复
热议问题