Rich:findComponent

1 resposta
R
<ui:include src="cadPessoa.xhtml">
    <ui:param name="id" value="Conjuge"/>
</ui:include>
<h:panelGrid 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="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:stella="http://stella.caelum.com.br/faces" 
	id="panelGroupDados#{id}" columns="3" width="100%">

	<h:panelGroup id="panelGroupCPF#{id}">
		<h:outputLabel styleClass="dr-pnl-b" for="inputCPF#{id}">CPF:</h:outputLabel>
		<h:outputText styleClass="required"
			rendered="#{rich:findComponent('inputCPF#{id}').required}" value="*" />
	</h:panelGroup>
	<a4j:region id="regionInpuCPF#{id}">
		<h:inputText id="inputCPF#{id}" value="#{pessoaFisicaMB.pessoaFisica.cpf}"
			alt="cpf" size="14" required="true" disabled="true">
			<stella:validateCPF formatted="true" />
			<rich:ajaxValidator event="onblur" reRender="inputCPF#{id}" />
		</h:inputText>
	</a4j:region>
	<rich:message id="inputCPFError#{id}" for="inputCPF#{id}"
		styleClass="dr-pnl-b errors" />

</h:panelGrid>

Como vocês podem ver no código acima, não funciona o rendered="#{rich:findComponent(‘inputCPF#{id}’).required}", pois ele não transforma o #{id} em Conjuge (‘inputCPF#{id}’).
Qual seria a maneira correta para ele transformar corretamente ???

Preciso fazer isto pois vou utilizar o mesmo cadastro em varias abas, logo não posso ter os mesmos ids. Teria que ser dinâmico mesmo.

1 Resposta

R

Ninguem, tem alguma dica, sobre esta duvida ?

Criado 25 de março de 2010
Ultima resposta 26 de mar. de 2010
Respostas 1
Participantes 1