Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

JSF File Upload

Thread view: 
Moiristo - 24 Jun 2006 23:50 GMT
Hi, I need your help again with this one.

I want to be able to upload a document (plain text) together with a name
and description. I've created the following jsf fragment for this:

    <h:form id="createForm">
    <table>
    <tr>
        <td><h:outputText value="#{labels.name}"/>: </td>        
    <td><h:inputText id="name" value="#{Bean.name}" /></td>
    </tr>
    <tr>
        <td><h:outputText value="#{labels.desc}"/>:   </td>
        <td><h:inputTextarea id="description"    
        value="#{Bean.description}" /> </td>
    </tr>
    </table>

    <h3><h:outputText value="#{labels.data}"/></h3>
    <h:form enctype="multipart/form-data">
         <t:inputFileUpload value="#{Bean.data}"/>
    </h:form>
    </p>
    <h:commandButton action="#{Uploader.uploadData}"
    value="#{labels.send}" />

    </h:form>

This does not work though. When I submit, nothing happens. I think there
is a problem with the nested multipart form, but I'm also not sure
whether the Tomahawk inputFileUpload tag will store the data in
Bean.data (byte[]).

I'd like to ask for this information all on one page. Is it for example
possible to split the forms have them both submitted with one
commandbutton? Any other ideas?
hiwa - 25 Jun 2006 00:34 GMT
Moiristo :

> Hi, I need your help again with this one.
>
[quoted text clipped - 32 lines]
> possible to split the forms have them both submitted with one
> commandbutton? Any other ideas?
Don't mix JSF actions with HTML tags. You shall get unpredictable
result.
For character size, use style element of JSF component.

Use a single form in a JSF view or use JSF sub-view.
You could do all of them in a single form, however.
Moiristo - 25 Jun 2006 14:25 GMT
> Don't mix JSF actions with HTML tags. You shall get unpredictable
> result.
> For character size, use style element of JSF component.

Are you talking about the table and h3 tag? I don't really see a problem
with this. But yes, it would be nicer to use as much jsf tags as possible.

> Use a single form in a JSF view or use JSF sub-view.
> You could do all of them in a single form, however.

Yes, few minutes after I posted this message, the Oracle of Google gave
me an example that showed me what to do. Thanks for the reply, however.
karthick.sundaram@gmail.com - 28 Jun 2006 18:33 GMT
Can you please share the link
Thanks

> > Don't mix JSF actions with HTML tags. You shall get unpredictable
> > result.
[quoted text clipped - 8 lines]
> Yes, few minutes after I posted this message, the Oracle of Google gave
> me an example that showed me what to do. Thanks for the reply, however.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.