-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi.
I have a listbox bounded with a model ( model='@{win$composer.allSalon}' ) that display 6 columns or elements per row, and i would like to change programatically the label of, lets say <listcell label='@{salon.descripcion}' />, the 4th element of the model in the current selected item. Any one who knows how i can do that?. Thanks in advance for the help.
code: null<listbox id="box" fixedLayout="true" model='@{win$composer.allSalon}' selectedItem='@{win$composer.current}'> <listhead sizable="true"> <listheader label="Campus" /> <listheader label="Id Salón" /> <listheader label="Nombre ' /> <listheader label="Descripción ' /> <listheader label="Capacidad ' /> <listheader label="Tipo ' /> </listhead> <listitem self='@{each='salon'}' value='@{salon}' id="oraitem"> <listcell label='@{salon.salonPK.idcampus}' id="celdacampus"/> <listcell label='@{salon.salonPK.idsalon}' /> <listcell label='@{salon.nombre}' /> <listcell label='@{salon.descripcion}' /> <listcell label='@{salon.capacidad}' /> <listcell label='@{salon.tipo}' /> </listitem> </listbox>code: null
inside my controller class y can change thelabel of the first index of each row of the model shown by doing something like this...
for(int i=0; i< box.getModel().getSize(); i++){
box.getItemAtIndex(i).setLabel( ((Salon) box.getModel().getElementAt(i)).getCampus().getNombre() );
}but i don´t know how to do what i described above. Any help would be appreciated.
Mike
any comments on this?
Good day, you may use something like this
Salon salon = (Salon) box.getModel().getElementAt(i); salon.setDescription("new description"); ((ListModelList)box.getModel()).set(i, salon); //model here fires datachange event and causes rendere? to rerender row
hope this helps
Asked: 2010-07-02 04:38:42 +0800
Seen: 228 times
Last updated: Jul 05 '10