0

When I need to look up the object that my controller finds in the base and return the object, but in my form does not show, only some fields.

When the field is disabled true the value is show but if disabled is false is not show !!

My form

<h:form id="frm" prependId="false">
      <p:panelGrid columns="2" layout="grid"
                styleClass="panelgrid-noborder"
                style="margin-top: 10px;"
                columnClasses="ui-grid-col-1, ui-grid-col-2">

            <p:outputLabel value="Id" for="id"/>
            <p:inputText id="id"
                        value="#{planoController.plano.id}"
                        disabled="true">
                <p:ajax event="blur" update="frm" listener="#{planoController.findById()}"/>        
            </p:inputText>          

        </p:panelGrid>

        <p:panelGrid columns="2" layout="grid"
                    styleClass="panelgrid-noborder"
                    style="margin-top: 10px;"
                    columnClasses="ui-grid-col-1, ui-grid-col-6">

            <p:outputLabel value="Nome" for="nome"/>
            <p:inputText id="nome"
                        value="#{planoController.plano.nome}"/>

        </p:panelGrid>

       <p:dataTable id="tblPlanos"
                    value="#{planoController.planos}"
                    var="plano"
                    rows="20"
                    paginator="true"
                    paginatorPosition="bottom"
                    reflow="true"
                    emptyMessage="Nenhum Plano Cadastrado">

                <p:column headerText="#" width="5%">
                    <p:commandButton icon="ui-icon-pencil" update="frm" immediate="true">
                        <f:setPropertyActionListener value="#{plano}" target="#{planoController.planoSelecionado}" />
                    </p:commandButton>
                </p:column> 
        </p:dataTable>

    </h:form>

My Controller

public void setPlanoSelecionado(Plano planoSelecionado) {
    this.planoSelecionado = planoSelecionado;
    findPlanoSelecionado();
}



 /**
 * Retorna Plano Selecionado
 * */
public void findPlanoSelecionado(){

    plano = this.planoService.findById(planoSelecionado.getId());

}

0 Answers0