Given the following XHTML code that has one
and a
having only two columns.
After doing this, if a row held by the given
<p:dataTable>
is updated (which in turn, updates<p:panel id="panel">
via<p:ajax>
inside<p:dataTable>
. It is sometimes necessary), the given<p:inputText>
in<p:panel id="panel">
causes validation its borders turn red implying violating the associated validation that should not happen.
This isn't what is happening. If that were true, you'd have seen 3 HTTP requests in the network monitor. But there are only 2 (one from the submit of the panel and one from the <p:remoteCommand>
).
The cause is the <p:remoteCommand>
itself. Its process
attribute defaults to @all
("whole view"). You can also confirm this by inspecting the javax.faces.partial.execute
request parameter in the network monitor. It says @all
. In other words, the entire form is also submitted/processed, including those empty inputs.
You need to explicitly set it to @this
:
<p:remoteCommand name="updateTable" process="@this" update="dataTable"/>