Combining p:carousel and p:lightBox

UI Components for JSF
Post Reply
cartagena
Posts: 6
Joined: 05 Aug 2011, 19:37

22 Sep 2011, 14:30

Hi guys,

I'm having some issue trying to combinate p:carousel and p:lightBox components. Occurs that, when I click on any image, the lightbox is showed and I can navigate between images (next and prev functions). When I'm on last image and I click on next, the current page is loaded into lightbox, not the first image.

The code is the follows:

Code: Select all

<p:lightBox currentTemplate="Foto {current} de {total}">
	<p:carousel value="#{detalhesImovelBean.imovel.fotos}" var="image" rows="6">
		<h:outputLink value="#{image.filePath}" title="#{image.description}">
			<h:graphicImage value="#{image.filePathP}" style="width:119px;height:91px;" />
		</h:outputLink>
	</p:carousel>
</p:lightBox>
I made some tests, removing the carousel component and the lightbox works well. Anyone had a similar issues?

My envoirment is:
Primefaces 3.0M3
Tomcat 7.0.20

Thanks

cartagena
Posts: 6
Joined: 05 Aug 2011, 19:37

22 Sep 2011, 18:43

I'm investigating and found something interesting. The function that collects the set of elements that will be showed in lightbox is that:

Code: Select all

$related = $('.' + boxElement).filter(function () {
    var relRelated = $.data(this, colorbox).rel || this.rel;
    return (relRelated === settings.rel);
});
The boxElement var has "cboxElement" as value, what results in an array with the images definied in carousel and the pages links for carousel, since the carousel page link has the html:

Code: Select all

<a class="ui-icon ui-carousel-page-link ui-icon-radio-off cboxElement" href="#"></a>
The filter considers that que pages links is part of set that will be showed in lightbox and, how the href propertie is #, the current page is loaded inside of lightbox.

This can be considered a bug?

cartagena
Posts: 6
Joined: 05 Aug 2011, 19:37

31 Oct 2011, 18:16

Hi guys!

I tried this combination with M4 and it didn't work! Actually, the image is not shown in the lightbox but in a new window.
Is someone trying to combine this two components too?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 73 guests