Hide button (p: commandbutton), Primefaces, with api PF

1

I'm trying to accomplish something seemingly simple, but I'm taking a damn spanking ... Studying, I read that Primefaces has a javascript / javascript api, so I decided to take a look. It turns out that I can not hide a button in any way, tried it in many ways and nothing ...

I'm posting below some of the forms I've tried, if I'm forgetting something, please help me:)

<!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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">


<h:head>

</h:head>

<h:body>


<h:form id="form1">

    <p:commandButton value="Hide" onclick="PF('oi1').hide();" id="aa1" update="form1"  />       
    <p:commandButton id="hh1" widgetVar="oi1" value="teste" />
            <br></br>
    <p:commandButton value="Hide" onclick="PF('form1:oi2').hide();" id="aa2" update="form1" />      
    <p:commandButton id="hh2" widgetVar="oi2" value="teste" />
            <br></br>
    <p:commandButton value="Hide" onclick="PF('#form1:oi3').hide();" id="aa3" update="form1" />         
    <p:commandButton id="hh3" widgetVar="oi3" value="teste" />
            <br></br>   
    <p:commandButton value="Hide" onclick="PF('#oi4').hide();" id="aa4" update="form1" />       
    <p:commandButton id="hh4" widgetVar="oi4" value="teste" />
            <br></br>
    <p:commandButton value="Hide" onclick="oi5.hide();" id="aa5" update="form1" />      
    <p:commandButton id="hh5" widgetVar="oi5" value="teste" />
            <br></br>
            <br></br>
            <br></br>
    <p:commandButton value="Hide" onclick="PF('oi6').hide()" id="aa6" update="form1" type="button"  />      
    <p:commandButton id="hh6" widgetVar="oi6" value="teste" />
            <br></br>
    <p:commandButton value="Hide" onclick="PF('form1:oi7').hide()" id="aa7" update="form1" type="button" />         
    <p:commandButton id="hh7" widgetVar="oi7" value="teste" />
            <br></br>
    <p:commandButton value="Hide" onclick="PF('#form1:oi8').hide()" id="aa8" update="form1" type="button" />        
    <p:commandButton id="hh8" widgetVar="oi8" value="teste" />
            <br></br>   
    <p:commandButton value="Hide" onclick="PF('#oi9').hide()" id="aa9" update="form1" type="button" />      
    <p:commandButton id="hh9" widgetVar="oi9" value="teste" />
            <br></br>
    <p:commandButton value="Hide" onclick="oi10.hide()" id="aa10" update="form1" type="button" />       
    <p:commandButton id="hh10" widgetVar="oi10" value="teste" />

</h:form>

</h:body>
</html>
    
asked by anonymous 17.10.2016 / 19:48

1 answer

1

I discovered in the Primefaces forum that you can not hide using PF, p: commandbutton does not have this possibility. I did it in jquery anyway.

    
25.10.2016 / 12:34