Boa tarde pessoal.
Sou iniciante em java, e estou tendo dificuldade em uma certa coisa.
Estou tentando ligar um Switch Case em uma combo de Select Item,
quando uma derteminada possiçao da combo for selecionada um determinado evento ocorrera através do Switch Case, porem eu não estou conseguindo chamar o evento,
sera que alguem pode me ajudar por favor?
segue codigo abaixo
==================
[code]public void exibirComponentes(ActionEvent event) {
Integer valorSelecionado = this.getViewHelper()
.getIncluirAdeIndivVO().getCestaServico();
switch (valorSelecionado) {
case Numeros.MENOS_UM:
this.getViewHelper().setExibeVigenciaCestaServico(true);
this.getViewHelper().setExibeDDD(true);
this.getViewHelper().setExibeCelular(true);
this.getViewHelper().setExibeComboOperadora(true);
break;
case Numeros.UM:
this.getViewHelper().setExibeVigenciaCestaServico(false);
this.getViewHelper().setExibeDDD(true);
this.getViewHelper().setExibeCelular(false);
this.getViewHelper().setExibeComboOperadora(false);
break;
case Numeros.DOIS:
this.getViewHelper().setExibeVigenciaCestaServico(false);
this.getViewHelper().setExibeDDD(false);
this.getViewHelper().setExibeCelular(true);
this.getViewHelper().setExibeComboOperadora(false);
break;
case Numeros.TRES:
this.getViewHelper().setExibeVigenciaCestaServico(false);
this.getViewHelper().setExibeDDD(false);
this.getViewHelper().setExibeCelular(false);
this.getViewHelper().setExibeComboOperadora(true);
break;
default:
this.getViewHelper().setExibeVigenciaCestaServico(false);
this.getViewHelper().setExibeDDD(false);
this.getViewHelper().setExibeCelular(false);
this.getViewHelper().setExibeComboOperadora(false);
break;
}
}
===========================
jsp
<br:brOutputTextBold styleClass=“HtmlOutputFormatBold”
value="#{msgs.label_cesta_de_servico}:" />
<br:brSelectOneMenu id="tipoAdesao" style="width: 200px"
onchange="exibirCompomentes();"
value="#{adesaoindividual_incluirAdeIndiv_IncluirAdeIndivBean.viewHelper.incluirAdeIndivVO.cestaServico}">
<f:selectItem itemLabel="Selecione" itemValue="-1" />
<f:selectItem itemLabel="Ambas" itemValue="1" />
<f:selectItem itemLabel="Individual" itemValue="2" />
<f:selectItem itemLabel="Compulsória" itemValue="3" />
</br:brSelectOneMenu>
</br:brPanelGrid>
===================
campo chamando exibeDDD.
</br:brPanelGrid>
<br:brPanelGrid columns="1" border="0" cellpadding="0"
rendered="#{adesaoindividual_incluirAdeIndiv_IncluirAdeIndivBean.viewHelper.exibeDDD}"
cellspacing="0" styleClass="gridSecundaria">
<br:brPanelGrid columns="3" border="0" cellpadding="0"
cellspacing="0" styleClass="gridSecundaria">
<br:brPanelGrid columns="1" border="0" cellpadding="0" id="GridDDD"
cellspacing="0" styleClass="gridInterna">
<br:brPanelGroup>
<br:brGraphicImage styleClass="bullet"
url="/template/images/bullet.jpg" />
<br:brOutputTextBold id="labelDDD"
styleClass="HtmlOutputFormatBold" value="#{msgs.label_ddd}:" />
</br:brPanelGroup>
<br:brInputText id="ddd" styleClass="HtmlInputText" maxlength="3"
size="4" alt="#{msgs.label_ddd}"
styleClass="HtmlInputTextObrigatorio"
value="#{adesaoindividual_incluirAdeIndiv_IncluirAdeIndivBean.viewHelper.incluirAdeIndivVO.ddd}">
</br:brInputText>
</br:brPanelGrid> [/code]
=========================================================
Desde já agradeço a todos