I have the following piece of code in my web page. After the method in action
executes a label is rendered indicating if the process was or not successful.
What I want is that label to be hidden right after the button is clicked. How can I achieve this?
I was thinking about using actionListener
but I don't know if it works like:
- Call actionListener's method
- Re-render myView (clear my label)
- Call action's method
- Re-render myView (show label whether the process was successful or not)
Or maybe something in the onclick="getElementById().hide"
?
Any ideas?
Cheers,
...
...
<a4j:commandButton id="btnActualizaCubo"
value="Actualizar Cubo"
render="messageDependenciaCubo actualizacionCuboLabels @this"
onclick="return confirm('Las fechas seleccionadas son correctas?');"
onbegin="this.disabled=true;
document.getElementById('formActualizacionCubo:imgProcesandoCubo').style.display='block'"
oncomplete="this.disabled=false;
document.getElementById('formActualizacionCubo:imgProcesandoCubo').style.display='none'"
action="#{administrationBean.doActualizaCubo}"/>
...
<a4j:outputPanel id="actualizacionCuboLabels" style="font-size: 14px; color: #D17100">
<h:outputText rendered="#{administrationBean.actualizacionCuboCorrectaLabelRendered}"
value="Actualización correcta !"/>
<h:outputText rendered="#{administrationBean.actualizacionCuboFalloLabelRendered}"
value="Fallo la actualización !"/>
</a4j:outputPanel>
...