My page has a search button to bring rates the address entered. After the research I want to be held to enable the print button.
<p:commandButton value="#{msg['btn-search']}"
styleClass="btn btn-primary" onclick="codeAddress()" />
<p:remoteCommand actionListener="#{searchBean.addMarker()}"
name="consultaValor"
update="bandeira1, bandeira2,bandeira1Value, bandeira2Value,origemInfo,addressInfo"/>
<p:commandButton id="print" value="Imprimir" styleClass="btn btn-primary" rendered="#{searchBean.print.booleanValue()}" >
<p:printer target="information" />
</p:commandButton>
I tried to use the rendered attribute that receives a boolean of my searchBean but did not work can anyone help me?
private Boolean print = false;
public Boolean getPrint() {
return print;
}
public void setPrint(Boolean print) {
this.print = print;
}
public void addMarker() {
Marker marker = new Marker(new LatLng(lat, lng),address);
emptyModel.addOverlay(marker);
result = true;
String wktFilter = "POINT("+getLng()+" "+getLat()+")";
findByWKT(wktFilter);
print = true;
}
The addMarker method is called by the search button then it went true to the boolean print but does not work.
booleanValue(), 2.onclickon acommandButtonmakes for some suprises. 3. So you're saying thatcodeAddresswill callconsultaValor? Are you sure the actionListener and the new render phase get to see the same bean (breakpoint the bean's constructor to find out)? - mabiupdate="... print"on thep:remoteCommand? - rion18