Component id does not recognise..

UI Components for JSF
Post Reply
st18dec
Posts: 16
Joined: 04 Jan 2012, 16:21

02 May 2012, 14:47

Hi all,

I have this code and try to show the client complaint status. when i click to view button of datatable row, it must be update dialog box contents, but when i tried to update any compinents like userName than it does not recognise this id, and error shows like

javax.faces.FacesException: Cannot find component with identifier "userName" in view.
at org.primefaces.util.ComponentUtils.findClientIds(ComponentUtils.java:249)
at org.primefaces.renderkit.CoreRenderer.buildAjaxRequest(CoreRenderer.java:222)
at org.primefaces.component.commandbutton.CommandButtonRenderer.encodeMarkup(CommandButtonRenderer.java:81)
at org.primefaces.component.commandbutton.CommandButtonRenderer.encodeEnd(CommandButtonRenderer.java:53)

I dont know what is cooking here, please help me out.

Thanks & Regard
Saurabh

Code: Select all

				<h:form id="form1">
 					<p:dialog id="dialog" footer="Client Complaint Details"  header="Complaint Detail" showEffect="clip" hideEffect="clip" widgetVar="complaintDialog"  resizable="true" closable="true">
 						<table cellpadding="3" cellspacing="3" width="100%">
 							<tr bgcolor="#54C571">
 								<th  align="center">
 									 Complaint message view
 								</th>
 							</tr>
 							<tr>
 								<td >
 									<h:panelGrid columns="2" cellpadding="5" cellspacing="0" >
							            <h:outputLabel style="color:Purple" for="userName" value="User Name : " />									
	 					                <h:outputText id="userName" value="#{userComplaint.selectedClientComplaint.name}" />  			                  
	 					                <h:outputLabel style="color:Purple" for="compName" value="Company  Name : " />  
						                <h:outputText id="compName" value="#{userComplaint.clientCompanyName}" />  			                  
	 					                <h:outputLabel style="color:Purple" for="time" value="Date Time : " />  
	 					                <h:outputText  id="time" value="#{userComplaint.clientComplaintDate}" />  			                
	 					                <h:outputLabel style="color:Purple" for="useremail" value="User Email : " />  
	 					                <h:outputText id="useremail" value="#{userComplaint.selectedClientComplaint.email}" />  			                
						                <h:outputLabel style="color:Purple" for="userphoneNumber" value="Phone Number : " />  
						                <h:outputText id="userphoneNumber" value="#{userComplaint.selectedClientComplaint.phoneNumber}" />  
						                <h:outputLabel style="color:Purple" for="userMsg" value="Message : " />
						                <h:panelGroup>
							                <div style="width:500px; overflow:auto;">  
			  					                <h:outputText style="color:green" id="userMsg" value="#{userComplaint.selectedClientComplaint.message}" />
			  					            </div> 
			  					        </h:panelGroup>     			                
						                <h:outputLabel  style="color:Purple" for="userstatus" value="Status : " /> 
	 		 			                <h:panelGrid columns="2">
						                	<h:outputText id="userstatus" value="#{userComplaint.selectedClientComplaint.status}"></h:outputText>
							                <p:selectOneMenu >
							                	<f:selectItem itemLabel="-- change --" itemValue=""></f:selectItem>
							                	<f:selectItem itemLabel="NEW" itemValue="NEW"></f:selectItem>
							                	<f:selectItem itemLabel="COMPLETE" itemValue="COMPLETE"></f:selectItem>
							                	<f:selectItem itemLabel="INPROGRESS" itemValue="INPROGRESS"></f:selectItem>
							                	<f:selectItem itemLabel="PENDING" itemValue="PENDING"></f:selectItem>
							                	<f:selectItem itemLabel="REOPEN" itemValue="REOPEN"></f:selectItem>
							                </p:selectOneMenu> 		                
						                </h:panelGrid>
						                <h:outputLabel style="color:Purple" for="userRemark" value="Remark : " />  
						                <h:inputTextarea id="userRemark" value="#{userComplaint.selectedClientComplaint.remark}" cols="50" rows="3" />
						                <h:outputLabel></h:outputLabel>
						                <h:panelGroup>  
	 										<p:commandButton value="Update"></p:commandButton> &nbsp;&nbsp;&nbsp;
									       	<p:commandButton value="close" onclick="complaintDialog.hide();" type="button" />
									    </h:panelGroup> 
   									</h:panelGrid>
 								</td>
 							</tr>
 						</table>  
				    </p:dialog>  
					<table  cellpadding="0" cellspacing="0" >
						<tr>
							<td>
				        		<p:messages id="message" showDetail="true" showSummary="false" autoUpdate="true"/>
							</td>
						</tr>
						<tr >
							<td valign="top"><h4><font color="orange">SparkTG </font>Complaint Messages </h4></td>						
						</tr>
						<tr>
							<td>
								<p:commandButton value="Refresh client complaint"  update="table,message" actionListener="#{userComplaint.refreshComplaintList}"></p:commandButton>
							</td>
						</tr>
						<tr>
							<td>
								<h:panelGrid>
									<p:dataTable  id="table"  rows="15" style="width:1000px"   var="complaint" value="#{userComplaint.clientComlaintList}"
													paginator="true" paginatorAlwaysVisible="false"	emptyMessage="No client message has been found yet.">
										<f:facet name="header">Client Complaints List</f:facet>
						                <p:column style="width:300px" headerText="User Name" >
						                    <h:outputText id="usrName" value="#{complaint.name}"/>
						                </p:column>
						                <p:column style="width:250px" headerText="Email">
						                    <h:outputText id="email" value="#{complaint.email}"/>
						                </p:column>
						                <p:column style="width:100px"  headerText="Ph. Num"  >
						                    <h:outputText id="phNum"  value="#{complaint.phoneNumber}"/>
						                </p:column>
						                <p:column style="width:100px" headerText="Date Time" >
						                    <h:outputText id="recieved_Time" value="#{complaint.problemDate}"/>
						                </p:column>
						                <p:column style="width:50px" headerText="Status" >
						                    <h:outputText id="_status" value="#{complaint.status}"/>
						                </p:column>
						                <p:column style="width:50px" headerText="Remark" >
						                    <h:outputText id="remark" value="#{complaint.remark}"/>
						                </p:column>
						                <p:column style="width:50px" headerText="View">
						                	<p:commandButton value="view" update="userName" icon="ui-icon-search" action="#{userComplaint.viewClientComplaintDetail}" oncomplete="complaintDialog.show()" title="View Detail">
						                       <f:setPropertyActionListener value="#{complaint}" target="#{userComplaint.selectedClientComplaint}" />
						                	</p:commandButton>
				 		                </p:column>					                
				 					</p:dataTable>	
								</h:panelGrid>
							</td>
						</tr>
					</table>
 				</h:form>



User avatar
T.dot
Expert Member
Posts: 620
Joined: 01 Feb 2012, 15:39
Location: Vienna/Austria

02 May 2012, 14:59

Please use forum search or google. Problems with "Cannot find component" have been discussed a lot.

And please follow the posting guidelines: viewtopic.php?f=3&t=1194

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 29 guests