Hi,

 I am really worried because I am trying to implement a simple file upload
in my application and I cannot manage to do it if I use Facelets and
Tomahawk.

Here: http://sback.it/jsfupload.war you find the little test application. 

I tried it without Facelets and it works perfectly, on the other side, when
I use facelets this part doesn't work:

[see file MyForm.xhtml, for the whole view]

<!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";
[CUT]
      xmlns:t="http://myfaces.apache.org/tomahawk";>
<body>
<ui:composition>


<h:form id="MyForm" enctype="multipart/form-data" >


    <h:messages globalOnly="true" styleClass="message"/>


    <h:panelGrid columns="3" border="0" cellspacing="5">


        <h:outputLabel for="myFileId" value="File: "/>

        <t:inputFileUpload id="myFileId"

            value="#{myBean.myFile}"

            storage="file"

            required="true"/>

        <h:message for="myFileId"/>


        [CUT]



        <h:commandButton value="Submit"
 action="#{myBean.processMyFile}"/>

        <h:outputText value=" "/>


    </h:panelGrid>


</h:form>

</ui:composition>
[CUT]

the attribute -enctype="multipart/form-data"- prevents the commandButton
action to be correctly perfomed. What I get is the form redisplaying without
any action on the bean.
If I remove the -enctype- attribute then the action is executed, but the
#{myBean.myFile} is not correctly filled with the file.

I searched for a solution for the whole afternoon, but without results.

I am using facelets 1.1.3 + jboss 4.0.5.GA + myfaces 1.1.5 + tomahawk 1.1.6
+ http://code.google.com/p/tomahawk-facelets/

Could you please help me! I am really worried for this problem :(

Thank you very much

Sback
-- 
View this message in context: 
http://www.nabble.com/Faceletes-and-MyFaces-Tomahawk-fileupload-tf4946575.html#a14162468
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to