Olá pessoal, estou precisando pegar um valor de um atributo via javascript utilizando um ID pelo método “document.getElementById”, a vi que o JSF ele vai herdando os nomes das ID dos elementos pais, assim descobrir que para o elemento não herda o ID utiliza-se o " prependId=“false” " só que não esta funcionando
exemplo quero pegar o atributo que tem a id = “testemaroto” dentro do form chamado “form”, não esta dando
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<style>
.top {
vertical-align: top;
}
.info {
height: 202px;
overflow: auto;
}
</style>
<f:view>
<h:form prependId="false" id="form" >
<h:outputText value="#{BeanTeste.texto}" id="testemaroto" />
<h:outputText value="#{BeanTeste.texto}" />
<rich:scrollableDataTable rowKeyVar="rkv" frozenColCount="1" height="400px"
width="700px" id="carList" rows="40" columnClasses="col"
value="2" var="category" sortMode="single">
<rich:column id="make">
<f:facet name="header"><h:outputText styleClass="headerText" value="Bruxao" /></f:facet>
<h:outputText value="#{BeanTeste.lista}" />
</rich:column>
<rich:column id="mileage">
<f:facet name="header"><h:outputText styleClass="headerText" value="Mileage" /></f:facet>
<h:outputText value="Nois na fita" />
</rich:column>
</rich:scrollableDataTable>
<a4j:commandButton value="Okay" reRender="form" />
<h:commandButton value="" onclick="abreAtividade()"/>
<div style="width:20%; height:100%;">
<rich:panel style="width:95%">
<rich:panelMenu>
<rich:panelMenuGroup label="Lista de diagramas">
<rich:panelMenuGroup label="1 Atividade X Y" onclick="abreAtividade()" >
<rich:panelMenuItem label="Confirmar Ocorrencia" >
</rich:panelMenuItem>
<rich:panelMenuItem label="Selecionar Ocorrencia" >
</rich:panelMenuItem>
<rich:panelMenuItem label="Cancela Ocorrencia" >
</rich:panelMenuItem>
<rich:panelMenuItem label="teste">
</rich:panelMenuItem>
</rich:panelMenuGroup>
</rich:panelMenuGroup>
</rich:panelMenu>
</rich:panel>
</div>
</h:form>
<script>
function abreAtividade()
{
var usuario = document.getElementById('testemaroto').value;
alert(usuario);
}
</script>
</f:view>
desde já um obrigado pela atenção