Código:
Imagen : http://s2.subirimagenes.com/imagen/p...7055layout.png<h:body> <p:layout fullPage="true" > <p:layoutUnit id="top" position="north" size="40"> <h:form prependId="false" id="menuBar"> <p:menubar autoDisplay="false" model="#{mantClienteMB.model}" /> <p:dialog header="Nuevo Elemento" widgetVar="dlg" resizable="false"> <h:panelGrid columns="2" style="margin-bottom:10px"> <h:outputLabel value="Crear nuevo elemento:" /> <p:selectOneMenu value="#{mantClienteMB.codElement}" filter="true" effect="fade" filterMatchMode="startsWith" style="width: 16em;"> <f:selectItem itemLabel="Seleccione" itemValue="" /> <f:selectItems value="#{mantClienteMB.elements}" var="elem" itemValue="#{elem.scActivityId}" itemLabel="#{elem.description}" /> <p:column> #{elem.description} </p:column> </p:selectOneMenu> </h:panelGrid> <p:commandButton value="Crear" actionListener="#{mantClienteMB.nuevoActividad}" update=":menuBar" oncomplete="dlg.hide();"/> <p:commandButton value="Salir" update=":menuBar" oncomplete="dlg.hide();"/> </p:dialog> </h:form> </p:layoutUnit> <p:layoutUnit id="bottom" position="south" size="60"> <div id="pie"></div> </p:layoutUnit> <p:layoutUnit id="left" position="west" size="300" resizable="true" closable="true" collapsible="true" header="Opciones" minSize="200"> <p:accordionPanel> <p:tab title="Calendario Actual"> <br /> <p:calendar mode="inline" navigator="none"/> <br /> </p:tab> </p:accordionPanel> </p:layoutUnit> <p:layoutUnit id="center" position="center"> <ui:insert name="contenido" /> </p:layoutUnit> </p:layout> </h:body>
Code Java:
Código:
Mensaje de Error:@Component("mantClienteMB") @Scope("view") public class MantenimientoClienteController implements Serializable { @Autowired private ActivityService activityService; private List<ScActivity> elements; private int codElement; @PostConstruct public void init() { try { this.setElements(new ArrayList<ScActivity>()); newElements(); menuBean(); } catch (Exception e) { e.printStackTrace(); } } private void newElements() { this.setElements(activityService.listarActivity()); } public void nuevoActividad() { System.out.println("==> "+codElement); } ......... }
Código:
com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException Grave: Error Rendering View[/pages/layoutComplex.xhtml] java.lang.ClassCastException: javax.faces.component.html.HtmlForm cannot be cast to org.primefaces.component.layout.Layout at org.primefaces.component.layout.LayoutUnitRenderer.encodeHeader(LayoutUnitRenderer.java:76) at org.primefaces.component.layout.LayoutUnitRenderer.encodeEnd(LayoutUnitRenderer.java:43) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1903) at javax.faces.render.Renderer.encodeChildren(Renderer.java:176) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1896) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1899) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1899) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1899) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:451) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) dic 14, 2013 8:39:40 PM com.sun.faces.context.ExceptionHandlerImpl throwIt Información: Exception when handling error trying to reset the response. java.lang.ClassCastException: javax.faces.component.html.HtmlForm cannot be cast to org.primefaces.component.layout.Layout at org.primefaces.component.layout.LayoutUnitRenderer.encodeHeader(LayoutUnitRenderer.java:76) at org.primefaces.component.layout.LayoutUnitRenderer.encodeEnd(LayoutUnitRenderer.java:43) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1903) at javax.faces.render.Renderer.encodeChildren(Renderer.java:176) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1896) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1899) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1899) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1899) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:451) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)