[jboss-user] [JBoss Seam] - Re: Simplest <s:fileUpload> usage

hispeedsurfer do-not-reply at jboss.com
Sat Jun 2 07:53:07 EDT 2007


in my case I see a upload field with button. But the values for file, filename and contenttype in the backing bean are always null and getter/setter are never called only I comment the s:fileupload. In ohter forms in my app there is no problem with fileupload only in this one.



  | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  |                       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  | <html xmlns="http://www.w3.org/1999/xhtml"
  | 	xmlns:ui="http://java.sun.com/jsf/facelets"
  | 	xmlns:h="http://java.sun.com/jsf/html"
  | 	xmlns:f="http://java.sun.com/jsf/core"
  | 	xmlns:s="http://jboss.com/products/seam/taglib"
  | 	xmlns:a="https://ajax4jsf.dev.java.net/ajax"
  | 	xmlns:rich="http://richfaces.ajax4jsf.org/rich"
  | 	xmlns:t="http://myfaces.apache.org/tomahawk">
  | <head>
  | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  | <title>sonderfreigabe</title>
  | <link href="./stylesheet/theme.css" rel="stylesheet" type="text/css" />
  | <link href="./stylesheet/date.css" rel="stylesheet" type="text/css" />
  | </head>
  | 
  | <body>
  | 	<div id="bodycontent">
  | 		<div id="north">
  | 			<div id="info">
  | 				<div id="text" class="infos">| Imprint | Contact | 02/23/2007</div>
  | 			</div>
  | 			<div id="corporateID">
  | 				<div id="hdrLogo"><img src="img/logo3.png" alt="logo" /></div>
  | 			</div>
  | 			<div id="bradgrum" class="infos">
  | 			</div>
  | 			<div id="status">
  | 				<a:status>
  | 					<f:facet name="start">
  | 						<h:graphicImage value="/img/mozilla_blu.gif"></h:graphicImage>
  | 					</f:facet>
  | 					<f:facet name="stop">
  | 						<h:graphicImage value="/img/connect_idle.gif"></h:graphicImage>
  | 					</f:facet>
  | 				</a:status></div>
  | 		</div>
  | 		
  | 		<div id="west">
  | 		<h:form>
  | 			<a:commandLink action="#{specialreleaseeditor.create}" value="New Specialrelease" reRender="center" immediate="true"></a:commandLink>
  | 		</h:form>
  | 		</div>
  | 		
  | 		
  | 			<h:panelGroup id="center">
  | 				<h:messages globalOnly="true" styleClass="message"/>
  | <!-- this is included normally with ui:include
  | 
  | <div id="content">
  | 	<span class="errors">
  |        <h:messages id="mainmassage" globalOnly="true"/>
  |     </span>
  | 		<div id="uppercontent2">
  | 			<h:form id="upperform" enctype="multipart/form-data">
  | 			<s:validateAll>
  | 			<div class="formfield" style="float: left; width: 100%;">
  | 				
  | 					<h:panelGrid id="upperPanelGrid" columns="1">
  | 						
  | 						
  | 						
  | 						
  | 						<s:decorate id="descriptionDecorator" template="edit.xhtml">
  | 							<ui:define name="label">Description:</ui:define>
  | 							<h:inputTextarea id="desc" value="#{specialreleaseeditor.description}" required="true">
  | 								<a:support event="onblur" reRender="descriptionDecorator"/>
  | 							</h:inputTextarea>
  | 							<br  />
  | 						</s:decorate>
  | 					
  | 						
  | 						
  | 						
  | 						
  | 						
  | 						
  | 						<s:decorate>
  | 							<h:panelGrid id="fileugrid">
  | 				                <h:outputLabel for="fileupload">File</h:outputLabel>
  | 				                <s:fileUpload id="fileupload" data="#{specialreleaseeditor.file}" accept="*/*" fileName="#{specialreleaseeditor.fileName}" contentType="#{specialreleaseeditor.fileContentType}"/>
  | 				                <br  />
  | 								<s:message></s:message>
  | 							</h:panelGrid>
  | 			            </s:decorate>
  | 						
  | 						
  | 						<h:panelGrid columns="1" id="grid">
  | 							<a:commandLink id="reg" value="Save" action="#{specialreleaseeditor.save}" reRender="center"/>
  | 							<a:commandLink id="can" value="Cancel" action="#{specialreleaseeditor.cancel}" reRender="center" immediate="true"/>
  | 						</h:panelGrid>
  | 						
  | 						
  | 					</h:panelGrid>
  | 				
  | 				
  | 			</div><!-- End class formfield -->
  | 			</s:validateAll>
  | 			</h:form>
  | 		</div><!-- End uppercontend -->
  | 		<div id="lowercontent2">
  | 			
  | 		</div><!-- End lowercontent -->
  | 	</div><!-- End content-->
  | 
  | 
  | -->					
  | 
  | 
  | 
  | 			</h:panelGroup>
  | 	</div>
  | </body>
  | </html>
  | 

If I fill the form an press save UIFileUpload.decode()  / processUpdates() called but they are no part of MultipartRequest.

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4050664



More information about the jboss-user mailing list