Programmatic PPR on af:outputText / af:outputFormatted

Partial page rendering (PPR) allows small areas of a page to be refreshed without the need to redraw the entire page. I had a scenario where an af:outputText component needs to be refreshed programmatically. The <af:outputText> tag looks like as ashown below.
 <af:outputText id="op1"  value="#{myBean.someValue}"  />

To PPR the outputText component, tried calling the following API from backing bean method.
Unfortunately this didn't help me out. Also, noticed the following warning message in the server console at runtime.$PPRTag finish
WARNING: no PPR-capable ID found for elements of: RichOutputText[UIXFacesBeanImpl, id=op1]
Further investigation on the above issue revealed some interesting points. Let me try summarizing them below.

Why does Programmatic PPR fail for <af:outputText>?

In an attempt to reduce content size of the web page, framework tries optimize the handling of auto-generated ids for af:outputText / af:outputFormatted components. This mean that, id will be generated only if it's really required by the client. The same 'id suppression' optimization is applicable even if you have id set explicitly for the component. One scenario where the id required at client side is during the partial page rendering of components. So adding the outputText as a 'partial target' declaratively will result in client side id generation. But in the above use case outputText needs to be updated programmatically, so there doesn't exist any explicit partialTriggers set declaratively.


Having said that, however there exist two possible solutions to work around this scenario.
1. Set clientComponent="true" for af:outputText which would generate the required client side id.
 <af:outputText id="op1" clientComponent="true" value="#{myBean.someValue}"  />

2. Disable 'id suppression' optimization at application level by adding the following context parameter in web.xml

The parameter can take two values
auto : Components can suppress auto generated IDs, but explicitly set ID needs to be honored.
explicit : This is the default value for parameter. In this case both auto generated IDs and explicitly set IDs would get suppressed


  1. Thanks, you help me a lot.
    I had the same problem !

  2. Thanks Jobinesh... helped me a lot

  3. Thanks, that was a nice tip.

  4. seriously it saved lot of time

  5. Thk a lot, this helped me a lot.


Post a Comment