Shadowman
Shadowman

Reputation: 12039

rich:fileUpload -- Nothing happening?

I'm trying to use RichFaces <rich:fileUpload> component (with Seam as the overall framework) to upload a series of files. However, when I click the "Add" button nothing happens. Absolutely nothing. I'm not prompted with an open dialog or anything.

I have a JSF page with an , and inside of that form I have:

<rich:fileUpload allowFlash="auto" id="contentImageUpload"
immediateUpload="true" maxFilesQuantity="5"
noDuplicate="true" required="true"
uploadData="#{contentSubmissionAction.contentImages}" />

The page renders fine, but when I click the "Add" button, nothing happens. The #{contentSubmissionAction.contentImages} property is a List of UploadItem's, so I thought that was setup properly. Has anyone seen this before? Is there something in the configuration that I could be missing that could cause this?

Upvotes: 0

Views: 2302

Answers (4)

Jens Kreidler
Jens Kreidler

Reputation: 480

It sounds very strange, but I had a broken rich:fileUpload due to the following css snippet included in my page:

input {
  width: 95%;
  passing-left: 3px;
}

Removing that or modifying that to

input[type="text"] 

for example, fixed the issue. I assume that this has got something to do with the generated

<input type="file" ... /> 

from RichFaces.

Upvotes: 0

donakalz
donakalz

Reputation: 85

In case you really need the included jquery file in the head of your web template but still would love to use your richfaces upload component, simply add this to the xhtml page:

jQuery.noConflict();

Of course that should be within script tags

Upvotes: 1

Shadowman
Shadowman

Reputation: 12039

I discovered the issue that was causing this. The web theme the site was using utilized jquery and included it in the <head>. This must have conflicted with the version included with RichFaces, because once I removed it everything started working again.

Upvotes: 1

BalusC
BalusC

Reputation: 1108642

Is everything been put inside a <h:form>? Have you checked the server logs for any exceptions? You may consider to play around with the source code which you can find in this demo (click View source).

Upvotes: 1

Related Questions