Note that there are some explanatory texts on larger screens.

plurals
  1. POZK ComboBox onchange changes all comboboxes in the listbox
    primarykey
    data
    text
    <p>I have an issue with a listbox and the combobox behaviour. I have a listbox with a group of rows and I try to edit inline and change the value of a field based on the values of a combobox. But when I select one value in the combo of one row then all the values of the comboboxes of the other rows change to the same value. Please, let me know what I am doing wrong. Thanks for your help!</p> <p>Here is my code:</p> <pre><code> &lt;template name="model" var="item"&gt; &lt;listitem &gt; &lt;listcell label="@load(item.id)"/&gt; &lt;listcell label="@load(item.descCodigoTrafico)"/&gt; &lt;listcell label="@load(item.descAmbitoDeTrafico)"/&gt; &lt;listcell&gt; &lt;combobox model="@load(vm.listaPrecioEspecial)" onChange="@command('addToUpdate', entry=item)" selectedItem="@load(item.precioEspecial) @save(item.precioEspecial, before='updateItems')"&gt; &lt;template name="model" var="el"&gt; &lt;comboitem label="@load(el)"/&gt; &lt;/template&gt; &lt;/combobox&gt; &lt;/listcell&gt; &lt;listcell label="@load(item.tipoDescuento)" /&gt; &lt;listcell&gt; &lt;decimalbox inplace="true" value="@load(item.ppm) @save(item.ppm, before='updateItems')" onChange="@command('addToUpdate', entry=item)" format="#.0000"/&gt; &lt;/listcell&gt; &lt;/listitem&gt; &lt;/template&gt; </code></pre> <p>And the code of the two methods in de VM:</p> <pre><code> @Command public void addToUpdate(@BindingParam("entry") TblEscenarioCondTrafico item){ itemsToUpdate.add(item); LOGGER.info(item.toString()); for(TblEscenarioCondTrafico i : itemsToUpdate){ LOGGER.info("Item a guardar " + i.toString()); //LOGGER.info("Elemento..."); } } @NotifyChange("listaTraficos") @Command public void updateItems() throws Exception{ EscenarioCondTraficoService ects = new EscenarioCondTraficoService(em); for (TblEscenarioCondTrafico i : itemsToUpdate){ LOGGER.info("Guardando " + i.toString()); ects.save(i); } itemsToUpdate.clear(); listaTraficos = getListaTraficos(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload