Hello,
When loading the page the method iniciarTeste()
will be called as follows:
<f:metadata>
<f:viewAction action="#{testeController.iniciarTeste()}" />
</f:metadata>
On the same page I have the field nome
that I would like to load with the value assigned in testeController
<ui:define name="body">
<div class="row">
<div class="col-md-12">
<div class="box box-default">
<h:form id="testeForm" name="testeForm">
<div class="box-body">
<div class="form-group col-md-12" id="divNome" name="divNome" >
<p:outputLabel value="#{testeController.nome}" id="nome" />
</div>
.
.
.
Follow the method:
Public String nome;
public void iniciarTeste() {
RequestContext context = RequestContext.getCurrentInstance();
context.update("testeForm:nome");
}
I also tested with:
context.update(":testeForm:nome");
When the update is to be performed:
Cannot find component for expression "testeForm:nome" referenced from "j_id1"
You know what I'm doing wrong? Or any idea how I can do it differently?
Thank you