Primefaces datatable update in f:facet name="header" not working
<p>I want to update a button in the header facet of a primefaces datatable and it does not work. I copied the button outside the datatable everything works fine.</p>

<p>The update should happen when the filter event of the datatable gets fired. I explicitly update the datatable, the outside- and the inside-button. </p>

<p>The intention is to display a button with an icon when no filter is set and another icon when a filter is used. In this example I simplyfied the use case: when no filter is used there is a open-lock icon, if I type something in a filter a closed-lock icon should be displayed. To release the lock one has to click the button (I did not implement the deletion of the filter in the datatable).</p>

<p>From what I understand I use the correct ID of the button inside the header. So I do not know why this does not work?</p>

<p>I am using mojarra 2.2 and primefaces 6.</p>

<pre><code>&lt;h:form id="id_form"&gt;
    &lt;p:dataTable
        id="id_table"
        value="#{stateController.names}"
        var="currentName"&gt;

        &lt;p:ajax
            event="filter"
            listener="#{stateController.markLocked()}"
            update="id_table id_form:id_table:id_button_inside id_form:id_button_outside"/&gt;

        &lt;p:column
            filterBy="#{currentName}"
            filterMatchMode="contains"&gt;
            &lt;f:facet name="header"&gt;
                &lt;p:commandButton
                    id="id_button_inside"
                    action="#{stateController.markUnlocked()}"
                    icon="#{stateController.locked ? 'ui-icon-locked' : 'ui-icon-unlocked'}" 
                    update="id_form"/&gt;
            &lt;/f:facet&gt;
            &lt;h:outputText value="#{currentName}" /&gt;
        &lt;/p:column&gt;
    &lt;/p:dataTable&gt;

    &lt;p:commandButton
        id="id_button_outside"
        action="#{stateController.markUnlocked()}"
        icon="#{stateController.locked ? 'ui-icon-locked' : 'ui-icon-unlocked'}" 
        update="id_form"
        /&gt;
&lt;/h:form&gt;
</code></pre>



<pre><code>@Named(value = "stateController")
@SessionScoped
public class StateController implements Serializable
{
    private boolean locked;
    private List&lt;String&gt; names;

    @PostConstruct
    private void init()
    {
        locked = false;
        names = new ArrayList&lt;&gt;();
        names.add("peter");
    }
    public void markLocked()
    {
        locked = true;
    }
    public void markUnlocked()
    {
        locked = false;
    }
    // getter + setter omitted
}
</code></pre>

<p>I also tried to put a button in a separate column. With this button (which is displayed in every row of the datatable) everything works fine as well.</p>