-
1. Re: S:fileUpload problem with a4j Commandbutton
meetoblivion Feb 16, 2009 5:46 AM (in response to tarunbansal84)I think you'll have to clarify what you mean by
It doesn't work.
if you could also post how you implemented it, it may help figure out why. Personally, I prefer richfaces' fileupload control, but that's just me. -
2. Re: S:fileUpload problem with a4j Commandbutton
tarunbansal84 Feb 17, 2009 5:53 AM (in response to tarunbansal84)I am using a simple backing bean and a byte array
`
the portion of code in seam component
private byte[] data;
public byte[] getData() {
return data;
}
public void setData(byte[] data) {
this.data = data;
}
public void action() {
System.out.println(this.getData().length);
}
code in Xhtml page:
<h:form id="fileEditForm" enctype="multipart/form-data">
<s:fileUpload data="#{excelUploadBean.fileData}" />
<h:commandButton value="Submit" id="submitExcel" action="{excelUploadBean.action}" >
</h:form>
`
when I replace the `<h:commandButton value="Submit" id="submitExcel" action="{excelUploadBean.action}" >` with `<a4j:commandButton value="Submit" id="submitExcel" action="{excelUploadBean.action}" >`
the "byte[] data"(in action method) remains null. -
3. Re: S:fileUpload problem with a4j Commandbutton
tarunbansal84 Feb 17, 2009 5:56 AM (in response to tarunbansal84)<blockquote>
_tarun bansal wrote on Feb 17, 2009 05:53:_<br/>
I am using a simple backing bean and a byte array
`
the portion of code in seam component
private byte[] data;
public byte[] getData() {
return data;
}
public void setData(byte[] data) {
this.data = data;
}
public void action() {
System.out.println(this.getData().length);
}
code in Xhtml page:
<h:form id="fileEditForm" enctype="multipart/form-data">
<s:fileUpload data="#{excelUploadBean.data}" />
<h:commandButton value="Submit" id="submitExcel" action="{excelUploadBean.action}" >
</h:form>
`
when I replace the `<h:commandButton value="Submit" id="submitExcel" action="{excelUploadBean.action}" >` with `<a4j:commandButton value="Submit" id="submitExcel" action="{excelUploadBean.action}" >`
the "byte[] data"(in action method) remains null.
</blockquote>
sorry the tag in xhtml for fileupload is <s:fileUpload data="#{excelUploadBean.data}" /> -
4. Re: S:fileUpload problem with a4j Commandbutton
shathomas Apr 22, 2009 8:39 PM (in response to tarunbansal84)I am having a similar problem. It works fine with h:commandLink, but when I use a4j:commandLink, the file upload control values ( filename and data ) are coming in as null values in the action bean.
Did you get it working? Would you please share the solution/workaround?
-
5. Re: S:fileUpload problem with a4j Commandbutton
aurelius Jun 16, 2009 10:13 AM (in response to tarunbansal84)I had the same problem also with files uploads, also for file downloads. Because for both cases I needed the a4j commandButton or commandLink to use f:setPropertyActionListener I've made the next trick: when I click a4j commandButton or a4j commandLink I am opening a modalPanel frame, and I am using s:link or s:button, depends what I need.