Ajax 요청 취소 문제가 있습니다. 우리의 어플리케이션 인터페이스는 RF로 구축되었습니다.RichFaces에서의 Ajax 요청 취소
진행률 표시 줄에 취소 버튼이 있어야합니다. 예를 들어 은 데이터베이스에서 채우기 컨트롤을 취소합니다. 그것을 만드는 방법?
컨트롤의 게터에서 "if"조건을 가진 플래그와 "bypassUpdates"를 사용하여 긍정적 인 효과가없는 페이지를 다시로드하려고했습니다. 당신의 도움이
XHTML (버튼)에 미리
감사 :
<a4j:commandButton id="showData"
value="View" styleClass="hBtn"
disabled="#{events.isButtonsDisabled}"
oncomplete="if (#{facesContext.maximumSeverity==null})
{window.open('/seed/pages/data.jsf','DATA')};"
actionListener="#{events.actionShow}"/>
JAVA (버튼) :
public void actionShow(ActionEvent evt) {
//Some logic, getting data from database
}
XHTML (메인 페이지 - 대기 팝업 표시)
<a4j:form>
<a4j:status id="ajaxStat"
onstart="Richfaces.showModalPanel('waitPanel');"
onstop="#{rich:component('waitPanel')}.hide()" />
</a4j:form>
XHTML (팝업) :
<rich:modalPanel id="waitPanel" autosized="true" moveable="false"
minWidth="250" styleClass="popup">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="Operation in progress"></h:outputText>
</h:panelGroup>
</f:facet>
<f:facet name="controls">
<h:panelGroup>
<h:graphicImage value="../images/icons/action_close.gif" styleClass="hidelink" id="hidelink"/>
<rich:componentControl for="waitPanel" attachTo="hidelink" operation="hide" event="onclick"/>
</h:panelGroup>
</f:facet>
<a4j:form id="msgFrm" ajaxSubmit="true">
<h:outputText value="Please wait..."/>
<h:graphicImage styleClass="progressBar" value="../images/indicatorbar.gif"/>
<a4j:commandButton value="Cancel" type="button"
onclick="#{rich:component('waitPanel')}.hide()"
action="#{main.cancelAction}"
bypassUpdates="true"/>
</a4j:form>
</rich:modalPanel>
JAVA (팝업) :
public void cancelAction(){
//there was setter for true/false flag for actionShow() here, now there is nothing here (it was not working)
}
자세한 내용을 보려면 Java 백업 빈이 요청을 완료하지 못하도록해야합니다. – Marcin
backing bean ... 일괄 처리를 시작할 때 변수를 true로 설정하고 작업을 취소해야하는 즉시 false로 설정할 수 있습니까? 그런 다음 백킹 빈은 해당 변수를 사용하여 지속 여부를 결정할 수 있습니다. –
나는 그것을 시도하고 작동하지 않습니다 – Marcin