imageSwitch not working as per Primefaces showcase demo site

UI Components for JSF
Post Reply
vikas v
Posts: 21
Joined: 23 Mar 2011, 14:24

01 Jun 2011, 09:23

Hi,

I am trying imageSwitch component available in prime faces in JSF2.0. I am using primefaces-2.2 jar.

But, after running I dont get anything on my browser. In Mozilla error console, I get error here,

---- error starts ---------

<div id="j_idt5:j_idt6"></div><script type="text/javascript">jQuery(function() {widget_j_idt5_j_idt6 = new PrimeFaces.widget.ImageSwitch('j_idt5:j_idt6',{fx:'FadeIn',speed:500,timeout:3000});});</script><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="1216696195714340459:1381584838182859477" autocomplete="off" />

------ error ends -----------

Below is the code as given in Primefaces showcase demo site.

---------------- Code starts ---------------------------------------


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">


<f:view content="text/html">
<h:body>
<h:form>

<p:imageSwitch effect="FadeIn">
<ui:repeat value="#{imageSwitchBean.images}" var="image">
<p:graphicImage value="/images/#{image}" />
</ui:repeat>
</p:imageSwitch>

</h:form>
</h:body>

</f:view>

</html>

---------------- Code ends --------------


I even tried with effect="fade" and also with below code, but not getting anything on browser.


<p:imageSwitch effect="FadeIn">
<p:graphicImage value="/images/image1" />
<p:graphicImage value="/images/image2" />
</p:imageSwitch>

vikas v
Posts: 21
Joined: 23 Mar 2011, 14:24

01 Jun 2011, 12:48

Is Prime faces supported on JSF 2.0? As per below link posted very long back,

http://primefaces.prime.com.tr/forum/vi ... ?f=3&t=104

its not yet.

Is that the problem?

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

01 Jun 2011, 13:07

PrimeFaces supports JSF 2.0 in fact it only support JSF 2.0. You are referring to a post that is 2 years before.

Do you have the user's guide for 2.2?

vikas v
Posts: 21
Joined: 23 Mar 2011, 14:24

01 Jun 2011, 14:17

Thanks.

I dont have that guide and have not yet gone through. Will look into it.

Regards,

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 68 guests