Fileupload with Carousel

UI Components for JSF
Post Reply
Gwate
Posts: 6
Joined: 12 Dec 2011, 22:49

12 Dec 2011, 22:56

Hey guys,

After upgrading to primefaces-3.0.RC1, i noticed that after clicking on an item in a carousel item selection, it would throw an error relating to the fileuploader, and if i took out the fileuploader component, it would again start working fine. Below is a simple example of code:

Carousel:

Code: Select all

								
                                                                    <div id="dr">
									<p:carousel id="rawr" value="#{cmsDesignBean.templateList}"
										var="templates"
										itemStyle="width:140px;height:100px; margin-left:14px">
										<p:column>
											<p:commandLink action="#{cmsDesignBean.updateTemplateImage}"
												ajax="true"
												update="designform:DesignAd, designform:SideDesign">
												<p:graphicImage id="TempImg"
													value="#{cmsDesignBean.carouselImages}" width="140px"
													height="100px">
													<f:param name="Streamed_Carousel" value="#{templates.id}" />
												</p:graphicImage>
												<f:setPropertyActionListener value="#{templates}"
													target="#{cmsDesignBean.templateImage}" />
											</p:commandLink>
										</p:column>
									</p:carousel>
								</div>
Simple Fileuploader component and submit:

Code: Select all

										<p:fileUpload id="DesignLogoUpload"
											value="#{cmsDesignBean.logoFile}" mode="simple"
											update="designform:DesignAd, dialogform:xyzBody"
											allowTypes="/(\.|\/)(gif|jpe?g|png|wbmp|bmp)$/"
											description="Select Images" />
										<p:commandButton value="Submit" ajax="false"
											action="#{cmsDesignBean.handleLogoUpload}" />
The actual error thrown is as follows:

Code: Select all

this.element.find(".fileupload-buttonbar button").unbind("click." + this.options.namespace).button is not a function
http://localhost:8080/ProjectName/javax.faces.resource/fileupload/fileupload.js.xhtml?ln=primefaces&v=3.0.RC1
Line 11
This would disable all javascript on the page, and it seems to activate after the onsuccess event as everything loads fine on the first click and is processed, just on the final update it throws this error and kills the page.

CaptainRichard
Posts: 16
Joined: 20 Oct 2011, 20:51

12 Dec 2011, 23:47

I noticed this bug as well. For me, I had set fileLimit="1" and removing that "fixed" the problem, insofar as the file upload now succeeds. I still get a JavaScript error about b.button not being a function after the upload completes, but it doesn't completely break all the JS on the page.
Running PrimeFaces 3.5 on JBoss AS 7.1.1.Final

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

12 Dec 2011, 23:54

That b.button error is also reported by our team, we'll look into that for 3.0 final.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 57 guests