Hi...
I have been using PhotoCam component with pf before, but now applying RIO layaout and theme something fail, basically the listener is not triggered, I'm not sure if its something related with Rio or PF (5.2) because before of using Rio it works
PhotoCam is not working
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
I tested with 5.2 but I didn't see a bug. Can you please attach a sample test.xhtml and TestBean.java for us to replicate?
Github Profile: https://github.com/mertsincan
Sure.aragorn wrote:I tested with 5.2 but I didn't see a bug. Can you please attach a sample test.xhtml and TestBean.java for us to replicate?
I'm using a basic example
Code: Select all
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
template="/WEB-INF/template.xhtml">
<ui:define name="content">
<h:form id="formCmp">
<p:photoCam widgetVar="pc" listener="#{testBean.oncapture}" forceFlash="true"/>
<p:commandButton type="button" value="Capture" onclick="PF('pc').capture()"/>
</h:form>
</ui:define>
</ui:composition>
Code: Select all
@ManagedBean(name = "testBean")
@SessionScoped
public class TestMngBean {
public void oncapture(CaptureEvent captureEvent){
LOG.log(Level.INFO, "capture photo");
}
}
With chrome I'm tracking the network data and I found some interesting information, when the button is pressed two items are displayed:
1) the captured image (GET Method)
2) A POST method to the jsf file with the following detail:
Code: Select all
<partial-response>
<error>
<error-name>org.apache.myfaces.view.facelets.el.ContextAwareMethodNotFoundException</error-name>
<error-message>
<![CDATA[javax.el.MethodNotFoundException: Return type 'void' of method 'oncapture' in 'class com.unitas.view.TestMngBean' does not match 'interface java.util.List']]>
</error-message>
</error>
</partial-response>
For some reason that I don't understand, now is required that the listener method returns a List object o_O
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
I tested with your code but I didn't see.
Test;
- created jetty-web.xml (WEB-INF/jetty-web.xml)
and added in its
- in testView.java
-in test.xhml
Test;
- created jetty-web.xml (WEB-INF/jetty-web.xml)
and added in its
Code: Select all
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd">
<Configure id="WebAppContext" class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="maxFormContentSize" type="int">600000</Set>
</Configure>
Code: Select all
package org.primefaces.rio.view;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import org.primefaces.event.CaptureEvent;
@ManagedBean(name = "testBean")
@SessionScoped
public class TestView {
public void oncapture(CaptureEvent captureEvent){
System.out.println("capture photo");
}
}
Code: Select all
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
template="/WEB-INF/template.xhtml">
<ui:define name="content">
<h:form id="formCmp">
<p:photoCam widgetVar="pc" listener="#{testBean.oncapture}" forceFlash="true"/>
<p:commandButton type="button" value="Capture" onclick="PF('pc').capture()"/>
</h:form>
</ui:define>
</ui:composition>
Github Profile: https://github.com/mertsincan
-
- Information
-
Who is online
Users browsing this forum: No registered users and 4 guests