Q:

Primefaces p:commandButton: disabled only working before f:setPropertyActionListener

I'm using <p:dataTable> and in a <p:column> I have a <p:commandButton> that must be disabled in one condition that is specified in the bean. 
Here's the form:
<p:dataTable var="flusso" id="flussoList" rows="5"
            widgetVar="flussoTable" value="#{invioFlussiTUManagedBean.flussi}"
            filteredValue="#{invioFlussiTUManagedBean.filteredFlussi}"
            emptyMessage="#{i18n['tu.msg.emptysearch']}" paginator="true"
            paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}">

     <p:column style="width:100px;height:35px;">

             <p:commandButton
                        update=":invioFlForm:flussoList :invioFlForm:displayConfirm"
                        icon="ui-icon-extlink" oncomplete="confirmation.show()"
                        title="#{i18n['tu.button.flusso.invia']}"
                        rendered="#{flusso.statoFlusso.code == 'DS'}"
                        disabled="#{!invioFlussiTUManagedBean.dettaglio}">
                        <f:setPropertyActionListener value="#{flusso}"
                            target="#{invioFlussiTUManagedBean.selectedFlusso}" />
                        <f:setPropertyActionListener value="#{false}"
                            target="#{invioFlussiTUManagedBean.modoInvioTutti}" />
            </p:commandButton>
     </p:column>
</p:dataTable>

In my ManagedBean:
public boolean isDettaglio() {
    return flussiTURepository.isDettaglio(selectedFlusso);
}

This method queries the database and returns true or false depending if selectedFlusso responds to a condition. 
The issue is this: in the method isDettaglio(), selectedFlusso is initialized in the f:setPropertyActionListener.  When the method is called, selectedFlusso is null. 
How do I set selectedFlusso so that in the disabled attribute of <p:commandButton> is not null? 

A:

The <f:setPropertyActionListener> is not invoked when the HTML representation of the button is rendered, as you seem to expect.  Instead, it is only invoked when the form is submitted via the button in question and its action is been queued. 
If you want to continue using this strange design — I'd have just used
disabled="#{!flusso.dettaglio}"

instead —, then your best bet is to programmatically evaluate #{flusso} inside the getter. 
public boolean isDettaglio() {
    FacesContext context = FacesContext.getCurrentInstance();
    Flusso currentFlusso = context.getApplication().evaluateExpressionGet(context, "#{flusso}", Flusso.class);
    return flussiTURepository.isDettaglio(currentFlusso);
}

Note that if your environment would support the new EL 2.2 feature of invoking methods with arguments, then you could just use
disabled="#{!invioFlussiTUManagedBean.isDettaglio(flusso)}"

See also How to call a method with a parameter in JSF. 
Regardless of the solution based on the current design, this design is "strange", because it's potentially very expensive.  See also Why JSF calls getters multiple times.