[Solved]Facelets, Primefaces 3.0 -> 3.1 and ID component

UI Components for JSF
Post Reply
emgiraldo
Posts: 3
Joined: 09 Feb 2012, 22:46

10 Feb 2012, 00:53

Hello guys,

I've read about the common problem of "Cannot find component with identifier "xxxxx" in view." but I actually can not figure out what is happening. I was using Primefaces 3.0.RC2 and everything worked ok, after I upgrade to the 3.1 Final Release version it just stopped working, that error keeps showing up. What I have is a main xhtml page:

Code: Select all

<?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:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
 
    <ui:composition template="../plantilla/plantillaDefecto.xhtml">
    	<ui:define name="content">
    		<center>   						 	
				 	<p:tabView id="testid" style="width:952px; font-size: 15px;" effect="blind">
				 		<p:tab title="Inicio">
				 			 <h:outputText  
				                   value="Es un servicio que le brinda la seguridad de tener sus equipos de aplicaciones críticas en una locación remota, fuera de sus instalaciones, y bajo un ambiente totalmente controlado, adecuado para mitigar cualquier eventualidad.
									Para ello, hemos desarrollado un ambiente seguro de clase mundial capaz de almacenar sus servidores y todo el equipo relacionado en sus implementaciones de cómputo. Los servidores propios o rentados son asignados dentro de un espacio 
									de rack o gabinete con energía, temperatura, ambiente regulado y conectividad ininterrumpida." />  
				 		</p:tab>
				 		<p:tab title="Gestion">	    	       	     			
				 			  <ui:include src="appliancerutina/appliancesrutina.xhtml" /> 
			 			</p:tab>			 			
	 					<p:tab title="Appliance">
						             <ui:include src="appliance/appliance.xhtml" />
	 					</p:tab>
	 					<p:tab title="Rutinas" id="rutina">
	 						 <ui:include src="rutina/rutina.xhtml" /> 
	 					</p:tab>			 				 								 							 							 			
					</p:tabView>
		 		
	 		</center>	
	 	</ui:define>
    </ui:composition>    
</html>
As you guys can see, it is a main page wich uses a general template and includes the pages. For example, the rutina.xthml page is:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
	<ui:composition>
	<h:form id="rutinaform">			
		<p:commandButton style="margin-left:706px;" oncomplete="rutinaDialog.show()" icon="ui-icon-plusthick" title="Adicionar" actionListener="#{rutinaControlador.resetCampos}" />
			<center>		
			<p:dataTable id="rutinaTable" var="rutina" value="#{rutinaControlador.listaRutinas}" tableStyle="width:auto" paginator="true" rows="10"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15">							                   			 		
		 				<p:column headerText="Id" style="width:100px">  
		         			<h:outputText value="#{rutina.idRutina}" />  
		     			</p:column> 
		 			  
		 				<p:column headerText="Nombre Rutina" style="width:100px">  
		         			<h:outputText value="#{rutina.nombreRutina}" />  
		     			</p:column> 
		     			
		     			<p:column headerText="Descripcion" style="width:100px">  
		         			<h:outputText value="#{rutina.descripcionRutina}" />  
		     			</p:column>		     					     			 	
		     			
		     			<p:column style="width:40px">  
             				<h:panelGrid columns="3" styleClass="actions" cellpadding="2">
             					<p:commandButton update="rutinaform:rutinaDialog" oncomplete="rutinaDialog.show()" icon="ui-icon-wrench" title="Editar">  
                     				<f:setPropertyActionListener value="#{rutina}" target="#{rutinaControlador.rutinaSeleccionada}" />  
                 				</p:commandButton>                 				                       				                   				
                 				<p:commandButton icon="ui-icon-trash" title="Eliminar" onclick="confirmationRutina.show()">  
                     				<f:setPropertyActionListener value="#{rutina}" target="#{rutinaControlador.rutinaSeleccionada}" />  
                 				</p:commandButton>
                 			</h:panelGrid>
                 		</p:column>         			
		 			</p:dataTable>
		 			
				<p:dialog header="Adicionar Rutina" widgetVar="rutinaDialog" resizable="false" id="rutinaDialog" 
				 					showEffect="fade" hideEffect="explode" modal="true">	
					<h:panelGrid id="rutinaDisplayPanel" columns="2" cellpadding="4" style="margin:0 auto;">					
						<h:outputText value="Nombre:" />  
		   				<h:inputText value="#{rutinaControlador.rutinaDto.nombreRutina}" style="font-weight:bold"/>            				
		   				<h:outputText value="Descripcion:"/>
		   				<h:inputTextarea value="#{rutinaControlador.rutinaDto.descripcionRutina}"/>
		   				<h:outputText value="Ejecutable:"/>
		   				<h:inputText value="#{rutinaControlador.rutinaDto.pathEjecutable}"/>
		   				<h:outputText value="Tipo:"/>
		   				<p:selectOneMenu value="#{rutinaControlador.rutinaDto.idTipoAppliance}" effect="fade" >
		            		<f:selectItem itemLabel="Seleccione una" itemValue="" />
		            		<f:selectItems value="#{tipoControlador.listaTipos}" var="tipo" itemLabel="#{tipo.nombreTipoAppliance}" itemValue="#{tipo.idTipoAppliance}" itemDescription="#{tipo.descripcionTipoAppliance}"/> 
		            	</p:selectOneMenu>
		            
																				  		   																  		   											   				 		   						   												   
		   			<p:commandButton  icon="ui-icon-save" update="rutinaform:rutinaTable" oncomplete="rutinaDialog.hide()" title="Guardar" actionListener="#{rutinaControlador.guardarRutina}" ajax="true"/>		   						   											   						   				
					</h:panelGrid>
				</p:dialog>
				<p:confirmDialog message="¿Esta seguro de eliminar la Rutina?"  
      				header="Eliminacion de appliance" severity="alert" widgetVar="confirmationRutina">                    
						<p:commandButton value="Si" update="rutinaform:rutinaTable" oncomplete="confirmationRutina.hide()" actionListener="#{rutinaControlador.borrarRutina}" ayax="true"/>  
						<p:commandButton value="Aun no" onclick="confirmationRutina.hide()" type="button" />   
	            </p:confirmDialog> 	
	    	 			    	
		</center>
		</h:form>
	</ui:composition>
</html>
When I load the page the following error appears:

javax.servlet.ServletException: Cannot find component with identifier "rutinaform:rutinaDialog" in view.

Any help or link would apreciated.

Thanks a lot guys.
Last edited by emgiraldo on 11 Feb 2012, 03:24, edited 1 time in total.

ybendek
Posts: 102
Joined: 05 Aug 2011, 17:52

10 Feb 2012, 05:35

I have the same problem....my application is throwing errors everywhere and all for the update to 3.1 :x :twisted: is very frustrating

tlteoh
Posts: 21
Joined: 24 Oct 2010, 16:33

10 Feb 2012, 07:10

for example you got growl inside the template

<p:growl id="growl" showDetail="true" />

try to update your growl using following

<p:commandButton value="Submit" update=":growl" actionListener="#{bean.function}" />

this should works.

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

10 Feb 2012, 07:53

This has been discussed many times.

Search google for:

forum.primefaces.org cannot find component 3.1

Please read the entire/following blog (and all other blogs posted by Optimus Prime)!

http://blog.primefaces.org/?p=1672
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

emgiraldo
Posts: 3
Joined: 09 Feb 2012, 22:46

11 Feb 2012, 03:23

Hello Guys,

I just solved my problem, basically what I did was to check how the code was being generated (How it was appending the ids to each element), use that syntax appending the : before the first element id and it worked. I posted what I did in my blog, it is not a tutorial or a manual or a high tech explanation, it is what solved my problem and let me continue with my job ;) .

I hope it helps someone with this problem.

http://emgiraldo.wordpress.com/2012/02/ ... -solution/

Thank you all for the answers.

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

11 Feb 2012, 03:57

Nice blog!

On another note, I don't use state saving = 'client'. As it was stated in the forum topic (that your blog referenced), this was not suggested as a (permanent) fix. You should revert to the solution discussed in the following forum topic (which was referenced in the forum topic that your blog referenced):

Cannot create a session after the response has been comitted
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 60 guests