Revision history [back]

click to hide/show revision 1
initial version

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

fabriko gravatar image fabriko

problem with selectedItem of listbox

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>
                    <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 just the item that the user have 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. Is there something i'm doing wrong?

problem with selectedItem of listbox

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>
                    <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 just the item that the user have 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. Is there something i'm doing wrong?

problem with selectedItem of listbox

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 The problem is when i I push the button Salva i Salva, I get on the vm.pickedItemSet just only the item that the user have chosen 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 model, I get just the one clicked. Is there something i'm doing wrong?clicked, whereas I want all three. How do I fix this?

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