Seam version 1.2.1. 

I am always getting NULL value for the upload file. I tried using both 
InputStream and byte[]; I also tried putting the upload file property in a SLSB 
and a class that extends EntityHome, but neither worked. Anyway here is my code:


  |     <h:form enctype="multipart/form-data">
  |         <rich:togglePanel id="importFeeds" switchType="ajax" 
stateOrder="closed, import">
  |             <f:facet name="closed">
  |                 <h:panelGrid columns="1">
  |                     <rich:toggleControl for="importFeeds" value="Import 
Feeds &#187;" />
  |                 </h:panelGrid>
  |             </f:facet>
  |             <f:facet name="import">
  |                 <h:panelGrid columns="1">
  |                     <s:fileUpload data="#{widgetHome.feedDefFile}" />
  |                     <s:button id="importFeed" value="Import..." 
action="#{widgetHome.importFeeds}"/>
  |                     <rich:toggleControl for="importFeeds" value="&#171; 
Close Import" />
  |                 </h:panelGrid>
  |             </f:facet>
  |         </rich:togglePanel>
  |     </h:form>
  | 


  | @Name("widgetHome")
  | public class WidgetHome extends EntityHome<Widget> {
  | 
  |         .... // other methods
  | 
  | 
  |     @Logger
  |     private Log log;
  |     
  |     // No matter whether it's byte[] or InputStream, it's always null
  |     private byte[] feedDefFile;
  |     //private InputStream feedDefFile;
  |     
  |     public void importFeeds() {
  |             // I get an NPE exception on this, because feedDefFile is 
always null
  |             log.info("feedDefFile.length = " + feedDefFile.length);
  |     }
  | 
  | }
  | 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033818#4033818

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033818
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to