0

changing label to listbox N element item

asked 2010-07-02 04:38:42 +0800

mikelara gravatar image mikelara
144
www.mextisa.com.mx

updated 2010-07-02 04:45:06 +0800

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

delete flag offensive retag edit

2 Replies

Sort by » oldest newest

answered 2010-07-03 13:27:38 +0800

mikelara gravatar image mikelara
144
www.mextisa.com.mx

any comments on this?

link publish delete flag offensive edit

answered 2010-07-05 08:14:03 +0800

Arsen gravatar image Arsen
384 5

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

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-07-02 04:38:42 +0800

Seen: 228 times

Last updated: Jul 05 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More