You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "squallmat ." <sq...@gmail.com> on 2014/08/07 18:07:36 UTC

select not updating in a zone

Hi,

I have a zone in which I have a select with a list of objects. When I
select a value, this one should be add in another list of chosen values,
and this value should disappear in the select. I've done that :


<t:zone t:id="terminalsZone" id="terminalsZone">
<t:Select t:value="selectedTerminal" t:id="selectTerminals"
model="selectTerminals" t:encoder="terminalDtoEncoder"
t:zone="terminalsZone" />
(${message:selectToAdd})
<br />
<t:Loop t:source="chosenTerminals" t:value="chosenTerminal"
t:formstate="ITERATION">
-&nbsp;${chosenTerminal.getNom()}<br />
</t:Loop>
</t:zone>



public Object onValueChanged(TerminalDto selectedTerminal) {
// availableModels = findAvailableModels(maker);
if (selectedTerminal != null) {
chosenTerminals.add(selectedTerminal);
listTerminals.remove(selectedTerminal);
}
selectedTerminal = null;
selectTerminals = selectModelFactory.create(listTerminals, "nom");

return terminalsZone.getBody();
}



The chosen values appear in my second list, but the remove from the
selectmodel doesn't work, the select list keeps all its original data.
why the select is not updated ?