0

problem with selectedItem of listbox [closed]

asked 2015-03-06 09:36:20 +0800

fabriko gravatar image fabriko
3 2

updated 2015-03-06 15:00:45 +0800

Hello, that's my code:

                    <listbox id="boxFirma" multiple="true"
                        visible="@load(vm.opzioneSelezionata eq 'firma' ? 'true' : 'false')"
                        checkmark="true" width="400px" height="200px"
                        model="@bind(vm.opzioniFirma)" 
                        selectedItems="@bind(vm.pickedItemSet)">
                        <template name="model" var="item"
                            status="s">
                            <listitem selected="@bind(item.preSelected)">
                                <listcell label="@bind(item.valore)" />
                            </listitem>

                        </template>
                    </listbox>
                     <button label="Salva" style="margin-top:10px" disabled="@load(empty vm.pickedUser)"
                onClick="@command('salvaPersonalizzazioneUtente')" />`

The problem is when I push the button Salva, I get on the vm.pickedItemSet only the item that the user has just chosen, but nothing about the preselected items -> 'listitem selected="@bind(item.preSelected)" ' . So if there were 2 items preselected and one clicked by the user on the view model, I get just the one clicked, whereas I want all three. How do I fix this?

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by terrytornado
close date 2015-03-09 13:47:00

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-03-08 12:14:21 +0800

Darksu gravatar image Darksu
1991 1 4

Hello fabriko,

You could accomplish your task by using java code as shown at the following example (The example is in mvc, but the logic is the same):

http://tugrulaslan.com/?p=300

Best Regards,

Darksu

link publish delete flag offensive edit
0

answered 2015-03-09 09:45:47 +0800

fabriko gravatar image fabriko
3 2

this works perfectly! thank you very much. unfortunately i can't give you a vote because of my low reputation. anyway for the admin this can be marked as solved.

link publish delete flag offensive edit

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-03-06 09:36:20 +0800

Seen: 19 times

Last updated: Mar 09 '15

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