0
votes

I have seen the question asked about how to rectify the component update code while migrating to Primefaces 3.1, preventing the exception

Cannot find component with identifier "...." in view.

But how to update a component that is not enclosed by a form element ? Such as I need to update, using remote command, the following ouputPanel:-

<p:outputPanel id='messageBox''>
     ...
</p:outputPanel>

Using : Primefaces 3.1 with JSF 2.1.6

2

2 Answers

2
votes

Just reference it by its absolute client ID instead. The update attribute is by default relative to the current UINamingContainer component (the <h:form> is such one). Assuming that the given <p:outputPanel> is by itself not inside any other UINamingContainer component, then just use update=":messageBox".

<p:commandButton ... update=":messageBox" />

If you're not sure, then you need to open the page in browser, do View Source and locate the generated HTML element of <p:outputPanel id="messageBox"> in there, take the exact value of its id attribute and then prefix it with the default naming container separator :.

0
votes

Specify an unique id for the "<h:form>" component, then use like below code to update a component

udpate="@(#messageBox)"