I want an input inside the p:dialog to be disabled until I open it, and when I close it, it needs to be disabled again.
I created a boolean variable in my bean and the input has disabled = boolean's value and it should work right. The button that opens the dialog has an action and an update attribute. In action I put the method that changes the boolean value, and in update the element I want to be updated (the input), but I get an exception:
java.lang.IllegalArgumentException: Intermediate identifier ventanaReserva in search expression ventanaReserva:gridReserva:usuario identifies a UIComponent that is not a NamingContainer
<h:form id="form" class="formulario">
...
<center><br/>
    <h:commandButton id="botonReserva" value="Reservar" onclick="PF('dlg').show();" 
      disabled="#{queryBean.noReservable}" action="#{queryBean.manejarApertura}" update=":form:nom :form:ventanaReserva:gridReserva:usuario" type="button" >
        <f:ajax execute="@this" render=":form:nom" />
    </h:commandButton> 
    <p:dialog id="ventanaReserva" header="Reservar oferta" widgetVar="dlg" focus="usuario" resizable="false">
        <p:ajax event="close" update=":form:nom :form:ventanaReserva:gridReserva:usuario" listener="#{queryBean.manejarCierre}" />
        <h:panelGrid id="gridReserva" columns="2" cellpadding="5">
            ...
            <h:inputText id="usuario" value="#{queryBean.usuario}" disabled="#{queryBean.inputUsuarioDesactivado}" /><br/>
            ...
        </h:panelGrid>
    </p:dialog>
    ...
</center>
 
    