You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Murray Brandon <mu...@hotmagna.com> on 2006/03/29 03:55:07 UTC

RE: Troubleshooting notes: ADF + Facelets + MyFaces Tomahawk + JSF

Speaking of file uploading...

I have a single form around my entire app of 600 pages (only 1 of which
is 'rendered' at any time so this should be fine).
However, to support file uploading I put enctype="multipart/form-data"
in the form definition as below.

        <h:form id="appform" prependId="false"
enctype="multipart/form-data">

And hey presto all my events from action commands stop firing.  Is this
a known side effect?
Does that mean I have to define sub-forms all over the place, each with
different encoding types?

(I'm using MyFaces + Tomahawk + ADF + Facelets, latest builds)

Regards, Murray

-----Original Message-----
From: Murray Brandon [mailto:murray@hotmagna.com] 
Sent: Wednesday, March 29, 2006 10:16 AM
To: users@facelets.dev.java.net
Subject: RE: Troubleshooting notes: ADF + Facelets + MyFaces Tomahawk +
JSF


I'm pretty sure Tomahawk needs commons-fileupload.jar to get
<t:inputFileUpload> working, because you don't just specify a byte array
where the uploaded file has to be put. It has a mime type, filename etc,
all of which is encapsulated in a class
org.apache.myfaces.custom.fileupload.UploadedFile.
Not that I have it working, however - will add to the troubleshooting
guide when it's going. (am trying to get an image editor type component
going)


RE: Troubleshooting notes: ADF + Facelets + MyFaces Tomahawk + JSF

Posted by Frank Felix Debatin <ff...@gmx.net>.
Hi Murray, 

in order to add "on-demand" attributes to the form tag in my template page,
I did the following

(template)

	<af:form>
		<ui:insert name="formOptions"/>
		...
		<ui:insert/>
	</af:form>

(template client)

<ui:composition template=".." ...>
	
	<ui:define name="formOptions">
		<f:attribute name="defaultCommand" value="LoginButton"/>
	</ui:define>
 
	<h1>Page body</h1>
</ui:composition>

Maybe you can use a similar pattern  to add the encType attribute.

Frank Felix

-----Original Message-----
From: Murray Brandon [mailto:murray@hotmagna.com] 
Sent: Wednesday, March 29, 2006 3:55 AM
To: 'MyFaces Official List'
Subject: RE: Troubleshooting notes: ADF + Facelets + MyFaces Tomahawk + JSF

Speaking of file uploading...

I have a single form around my entire app of 600 pages (only 1 of which is
'rendered' at any time so this should be fine).
However, to support file uploading I put enctype="multipart/form-data"
in the form definition as below.

        <h:form id="appform" prependId="false"
enctype="multipart/form-data">

And hey presto all my events from action commands stop firing.  Is this a
known side effect?
Does that mean I have to define sub-forms all over the place, each with
different encoding types?

(I'm using MyFaces + Tomahawk + ADF + Facelets, latest builds)

Regards, Murray

-----Original Message-----
From: Murray Brandon [mailto:murray@hotmagna.com]
Sent: Wednesday, March 29, 2006 10:16 AM
To: users@facelets.dev.java.net
Subject: RE: Troubleshooting notes: ADF + Facelets + MyFaces Tomahawk + JSF


I'm pretty sure Tomahawk needs commons-fileupload.jar to get
<t:inputFileUpload> working, because you don't just specify a byte array
where the uploaded file has to be put. It has a mime type, filename etc,
all of which is encapsulated in a class
org.apache.myfaces.custom.fileupload.UploadedFile.
Not that I have it working, however - will add to the troubleshooting
guide when it's going. (am trying to get an image editor type component
going)