voyent
Two selectonemenu in Netbeans  XML
Forum Index -> Woodstock to ICEfaces Migration
Author Message
edanco

Joined: 17/Jun/2009 00:00:00
Messages: 16
Offline


Hi,

I need put two selectonemenu, but the second depend of value selected in the first selectonemenu.
I tried using valueChangeListener in the first selectonemenu but the second selectonemenu no change.


- First Selectonemenu

<ice:selectOneMenu binding="#{paginas$modiusuarios.selectOneMenu1}" id="selectOneMenu1" partialSubmit="true"
valueChangeListener="#{paginas$modiusuarios.cambio}">
<f:selectItems id="selectOneMenu1selectItems" value="#{paginas$modiusuarios.listaFincas}"/>
</ice:selectOneMenu>


- Second Selectonemenu

<ice:selectOneMenu binding="#{paginas$modiusuarios.selectOneMenu2}" id="selectOneMenu2" partialSubmit="true" rendered="true">
<f:selectItems id="selectOneMenu2selectItems" value="#{paginas$modiusuarios.listaCentros}"/>

</ice:selectOneMenu>




public void cambio(ValueChangeEvent event) {

setDatoFinca( (String) selectOneMenu1.getValue());




Short n = Short.parseShort(getDatoFinca());
Short e =1;

List<Centrocosto> c = centrocostoFacade.findxFinca(e, n);

datos1 = new ArrayList();
if (c.size() > 0 ){
for (int i = 0; i < c.size(); i++){
si = new SelectItem();
si.setLabel(c.get(i).getNombre());
si.setValue( String.valueOf(c.get(i).getCentrocostoPK().getCodigo() ) );
datos1.add(si);


}
}
setListaCentros(datos1);





}




Thanks

 
Forum Index -> Woodstock to ICEfaces Migration
Go to:   
Powered by JForum 2.1.7ice © JForum Team