我的網頁中有以下一段代碼。在action
中的方法執行之後,將呈現指示過程是否成功的標籤。單擊按鈕後隱藏標籤richfaces
我想要的是該標籤隱藏在按鈕被點擊後。我怎樣才能做到這一點?
我想使用actionListener
但我不知道,如果它的工作原理是:
- 調用的ActionListener的方法
- 重新渲染MyView的(清除我的標籤)
- 呼叫行動的方法
- 重新渲染myView(顯示標籤過程是否成功)
或者,在onclick="getElementById().hide"
?
任何想法?
乾杯,
...
...
<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>
...
謝謝Luiggi我會嘗試你對標籤的建議。有一個線程,我問這裏的圖像http://stackoverflow.com/questions/10900860/disable-button-and-show-loading-image-while-processing-jsf – BRabbit27
@ BRabbit27你使用JSF 1.2或JSF 2 ? –
JSF 2.1.6(Mojarra) – BRabbit27