Im은 Primefaces4.0을 JSF2.0과 함께 사용하여 Primeface의 기본 사항을 알고 있습니다. 나를 위해 p:fileUpload
가 작동하지 않습니다. 이전에 작동했습니다. 무슨 일이 생기는지 모르겠다 파일 선택기에서 파일을 선택할 때 p : fileUpload의 파일 팬에 채워진 파일이 없습니다.Primefaces p : fileUpload가 작동하지 않습니다.
<p:panel style="font-size:15px;" header="Upload">
<p:fileUpload fileUploadListener="#{addAgentxls.handleFileUpload}" mode="advanced" dragDropSupport="true"
update="messages status" sizeLimit="100000" style="font-size:12px;" />
<p:growl id="messages" showDetail="true"/>
<p:outputLabel id="status" style="font-size:13px;" value="#{addAgentxls.status }"/>
</p:panel>
클래스 파일 :
@ManagedBean(name = "addAgentxls", eager = true)
@SessionScoped
public class AddAgentUsingXLS {
public AddAgentUsingXLS(){
}
public void handleFileUpload(FileUploadEvent event) {
FacesMessage msg = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded.");
FacesContext.getCurrentInstance().addMessage(null, msg);
}
}
의 web.xml :
<!-- File Uploading Constraints -->
<filter>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
나는 또한 오류가 발생 나를 위해 This 수행 아무것도 볼 여기
내 코드입니다 Google 크롬 브라우저Uncaught TypeError: Object [object Object] has no method 'fileupload'
fileupload.js.xhtml?ln=primefaces&v=4.0:1
아무 가치가 없나요?
양식에 enctype = "multipart/form-data"를 추가했는지 확실하지 않습니다. – psi
그래도 패널이 h로 추가됩니다. 양식 – Sarz
참조 http://stackoverflow.com/questions/16166039/uncaught-typeerror-cannot-read-property-value-of-undefined-using-primefaces-f/16168985#16168985 – psi