rich:fileUpload
과
a4j:commandButton
을 사용하는 페이지는 제가 페이지는 파일 업로드가 나타나지 말아야로드 처음이다 (렌더링, 내 backingBean 기본이 참 달성하고 싶은 것은 그래서 렌더링 한
제대로) 사용자가있는 명령을 칠 때 나는 이런 일이되지합니다 (파일 업로드를 숨길 사랑하고 outputText
을 보여줄 것이다, 오류없는 전혀)Richfaces는 A4J 렌더링 : 아약스는
나는이 문제를 해결할 수있는 방법
<div id="content">
<a4j:outputPanel id="contentForm">
<h:form enctype="multipart/form-data"
rendered="#{uploadBean.formRendered}">
<br/><br/>
<h:selectOneRadio value="#{uploadBean.selectedOption}">
<f:selectItems value="#{uploadBean.loadOptions}"/>
</h:selectOneRadio>
<br/>
<rich:fileUpload addLabel="Agregar" clearAllLabel="Quitar todos"
clearLabel="Quitar" deleteLabel="Quitar"
doneLabel="Completado" uploadLabel="Subir archivos"
fileUploadListener="#{uploadBean.doUpload}"
acceptedTypes="txt, csv"
noDuplicate="true"/>
<a4j:commandButton value="Iniciar validación"
action="#{uploadBean.doLaunchProcess}"
render="processLabel"
execute="@form"
/>
</h:form>
</a4j:outputPanel>
<a4j:outputPanel id="processLabel">
<h:outputText
value="#{uploadBean.processStarted}"
rendered="#{not uploadBean.formRendered}"/>
</a4j:outputPanel>
</div>
처럼 내 pagelooks
이고 commandButton의 액션 코드는
입니다.public String doLaunchProcess() {
formRendered = false;
InfoValidator iv = new InfoValidator(loadOptions,
selectedOption, userBean.getDependencia(),
userBean.getTipoDependencia(), userBean.getUsuario(),
userBean.getIdUsuario(), userBean.getEmail());
iv.start();
return "carga-archivos";
}
되어 나는 그것이 사용자가 버튼 그래서 파일 업로드의 가죽을 클릭하면 거짓과이 outputText을 표시 할 때 formRendered
항상 true로 평가되는 것 같다.
UPDATE는 기본적으로 내가 원하는 파일을 업로드 할 수있는 사용자 인 경우 파일 업로드 컴포넌트 사라져과이 outputText가 나타나고 사용자가 버튼을 클릭 말했다 어쩌면
내 접근 "업로드 주셔서 감사합니다"같은 틀렸어. 그냥 올바른 방향으로 넣어 줘. 나는 아약스와 혼동스러워.
건배,
render = "processLabel"대신 rerender = render "processLabel" – HRgiger
a4j : commandButton에 'reRender' 속성이 없습니다. 나는 richfaces 4.1 및 Mojarra 2.1.6과 Tomcat – BRabbit27
을 사용하고 있습니다. 사용중인 cas를 지원한다고 생각합니다. http://stackoverflow.com/a/2243473/706695 또는 http://docs.jboss.org/를 확인하십시오. richfaces/latest_3_3_X/ko/devguide/html/a4j_commandButton.html # 6.1.6.2. % 20Details % 20of % 20Usage – HRgiger