Olá!!
Estou com um problema para usar javascript + JSF
quero fazer com que ao clicar em um botão um campo se esconda
estou fazendo algo assim:
_template:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!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:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:s="http://jboss.org/seam/faces">
<h:head>
<title>teste</title>
<link rel="StyleSheet" type="text/css" href="midia/css/style.css"/>
<h:outputScript library="js" name="jquery.min.js" />
<link rel="StyleSheet" type="text/css" href="midia/css/skin_dark_driver.css"/>
</h:head>
<h:body>
<div id="cabecalho">
<iframe allowtransparency="true" id="thatframe" style="overflow: hidden;" src="midia/cabecalho.jsp" frameborder="0" width="1008" height="150"></iframe>
</div>
<div id="conteudo" width="1008">
<ui:insert name="corpo"/>
</div>
<div id="rodape">
<iframe ALLOWTRANSPARENCY="true" style="overflow:hidden;" FRAMEBORDER="0" width="1004" height="17" src="midia/rodape.htm"></iframe>
</div>
</h:body>
</html>
página:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
template="\_template.xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:s="http://jboss.org/seam/faces">
<script>
function teste() {
document.getElementById["form:botoes"].style.display = 'none';
}
</script>
<ui:define name="corpo">
<link rel="StyleSheet" type="text/css" href="midia/css/editar.css"/>
<h:form id="botoes" prependId="false">
<p:commandButton value="Concluir" action="#{anexoBean.grava}" />
<p:commandButton value="Confirmar" onclick="return teste();"/>
</h:form>
</ui:define>
</ui:composition>
e não ta dando certo…
não sei se estou colocando o javascript / script em local errado
ou o que está acontecendo…
obrigado!!