<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fabio Brandão - Blog &#187; RichFaces</title>
	<atom:link href="http://www.fnbrandao.com.br/blog/tag/richfaces/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fnbrandao.com.br/blog</link>
	<description></description>
	<lastBuildDate>Tue, 24 Aug 2010 01:33:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>JSF &#8211; Duplicate componentID</title>
		<link>http://www.fnbrandao.com.br/blog/2008/05/jsf-duplicate-componentid/</link>
		<comments>http://www.fnbrandao.com.br/blog/2008/05/jsf-duplicate-componentid/#comments</comments>
		<pubDate>Fri, 23 May 2008 18:07:28 +0000</pubDate>
		<dc:creator>fabio</dc:creator>
				<category><![CDATA[Java EE]]></category>
		<category><![CDATA[Programação]]></category>
		<category><![CDATA[JEE]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[RichFaces]]></category>

		<guid isPermaLink="false">http://www.fnbrandao.com.br/blog/?p=11</guid>
		<description><![CDATA[Utilizando o DataTable do RichFaces em uma simples página, após um reload na página sempre era retornado o seguinte erro:
Duplicate component ID '_id0:_dataTable:_id1' found in view.
Segue abaixo o código da página que causava o erro:

&#60;ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
	xmlns:rich="http://richfaces.ajax4jsf.org/rich"&#62;

	&#60;h:form binding="#{UserConsultPage.component}"&#62;
		&#60;rich:dataTable id="dataTable"
			binding="#{UserConsultPage.dataTable}" var="item"&#62;
			&#60;rich:column&#62;
				&#60;f:facet name="header"&#62;
					&#60;h:outputText value="Name" /&#62;
				&#60;/f:facet&#62;
				&#60;h:outputText value="#{item.name}" /&#62;
			&#60;/rich:column&#62;
			&#60;rich:column&#62;
				&#60;f:facet name="header"&#62;
					&#60;h:outputText value="Email" /&#62;
				&#60;/f:facet&#62;
				&#60;h:outputText value="#{item.email}" /&#62;
			&#60;/rich:column&#62;
		&#60;/rich:dataTable&#62;

		&#60;h:commandButton id="btnLoad" actionListener="#{UserConsultPage.load}" /&#62;
	&#60;/h:form&#62;

&#60;/ui:composition&#62;

A solução foi colocar [...]]]></description>
			<content:encoded><![CDATA[<p>Utilizando o DataTable do RichFaces em uma simples página, após um reload na página sempre era retornado o seguinte erro:</p>
<p><code>Duplicate component ID '_id0:_dataTable:_id1' found in view.</code></p>
<p>Segue abaixo o código da página que causava o erro:</p>
<p><code>
<pre>&lt;ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
	xmlns:rich="http://richfaces.ajax4jsf.org/rich"&gt;

	&lt;h:form binding="#{UserConsultPage.component}"&gt;
		&lt;rich:dataTable id="dataTable"
			binding="#{UserConsultPage.dataTable}" var="item"&gt;
			&lt;rich:column&gt;
				&lt;f:facet name="header"&gt;
					&lt;h:outputText value="Name" /&gt;
				&lt;/f:facet&gt;
				&lt;h:outputText value="#{item.name}" /&gt;
			&lt;/rich:column&gt;
			&lt;rich:column&gt;
				&lt;f:facet name="header"&gt;
					&lt;h:outputText value="Email" /&gt;
				&lt;/f:facet&gt;
				&lt;h:outputText value="#{item.email}" /&gt;
			&lt;/rich:column&gt;
		&lt;/rich:dataTable&gt;

		&lt;h:commandButton id="btnLoad" actionListener="#{UserConsultPage.load}" /&gt;
	&lt;/h:form&gt;

&lt;/ui:composition&gt;</pre>
<p></code></p>
<p>A solução foi colocar id&#8217;s em todos os componentes <em>&#8220;outputText&#8221;</em>. Segue abaixo a página modificada:</p>
<p><code>
<pre>&lt;ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
	xmlns:rich="http://richfaces.ajax4jsf.org/rich"&gt;

	&lt;h:form binding="#{UserConsultPage.component}"&gt;
		&lt;rich:dataTable id="dataTable"
			binding="#{UserConsultPage.dataTable}" var="item"&gt;
			&lt;rich:column&gt;
				&lt;f:facet name="header"&gt;
					&lt;h:outputText <strong>id="headerNameValue"</strong> value="Name" /&gt;
				&lt;/f:facet&gt;
				&lt;h:outputText <strong>id="nameValue"</strong> value="#{item.name}" /&gt;
			&lt;/rich:column&gt;
			&lt;rich:column&gt;
				&lt;f:facet name="header"&gt;
					&lt;h:outputText <strong>id="headerEmailValue"</strong> value="Email" /&gt;
				&lt;/f:facet&gt;
				&lt;h:outputText <strong>id="emailValue"</strong> value="#{item.email}" /&gt;
			&lt;/rich:column&gt;
		&lt;/rich:dataTable&gt;

		&lt;h:commandButton id="btnLoad" actionListener="#{UserConsultPage.load}" /&gt;
	&lt;/h:form&gt;

&lt;/ui:composition&gt;</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fnbrandao.com.br/blog/2008/05/jsf-duplicate-componentid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
