Primefaces 3.1.x upgrade 注意事項
1. Upgrade 至 primefaces 3.1 目前遇到的問題是:
Cannot find component with identifier XXX in view
http://blog.primefaces.org/ 這裡提到:
Component referencing is now aligned with JSF Spec, if PrimeFaces cannot find a component,
it will throw an exception. Since PrimeFaces 2.2 we’ve been logging an info message that
component cannot be found and falling back to the client id. If you haven’t ignored these
messages and fixed your code since 2.2, there won’t be a problem. If not, you need to update
your component referencing with respect to findComponent specification.
測試的結果是:
如果你的元件與 XXX 是同一個 parent(UINamingContainer?, 如 h:form,
ui:repeat, …)時, XXX 不用變,
若不同的話, 必需設定 update=":XXXParent:XXX"這種格式.
若 XXX 沒有 parent(UINamingContainer), 如 <p:messages id="msg1"/>不在 form
裡時
則要寫成 update=":msg1"
评论0