Revision history [back]

click to hide/show revision 1
initial version

asked 2022-12-14 20:00:12 +0800

AnkitIan gravatar image AnkitIan

Clear combobox list on select

Hi My code is as follows:

<vbox> <combobox id="supervisors" placeholder="${ b:l('str.workload.user_supervisor') }" model="@load(vm.supervisors)" autodrop="true" selecteditem="@bind(vm.selectedSupervisor)" onselect="@command('showSupervisorUsers')" visible="@load(vm.callCenterManager)"> <template name="model" var="user"> <comboitem label="@load(user.name)"/> </template> </combobox> <listbox id="listbox_supervisorUsers" selecteditems="@bind(vm.selectedSupervisorUser)" rows="4" multiple="true" width="300px" height="300px" model="@load(vm.supervisorUsers)" checkmark="true"> <template name="model" var="user"> <listitem label="@load(user.name)"/> </template> </listbox> </vbox> <vbox vflex="1" pack="middle"> <button label="&gt;" onclick="@command('addUsersToUserGroup')"/> <button label="&lt;" onclick="@command('removeUsersFromUserGroup')"/> </vbox> <vbox> <combobox id="listbox_userGroups" placeholder="${ b:l('str.workload.user_group') }" model="@load(vm.userGroups)" autodrop="true" selecteditem="@load(vm.selectedUserGroup, before='clearSelection')" onselect="@command('showUserGroupUsers')" &gt;="" <template="" name="model" var="userGroup" id="listbox_userGroups_items"> <comboitem label="@load(userGroup.description)"/> </template> </combobox> <listbox id="listbox_groupUsers" rows="4" multiple="true" width="300px" height="300px" model="@load(vm.groupUsers)" selecteditems="@bind(vm.selectedUser)" checkmark="true"> <template name="model" var="user"> <listitem label="@load(user.name)" disabled="@load(user.disabledUser)"/> </template> </listbox> </vbox>

When i click on first combobox then the information is displayed on other combobox but when i select again the first combobox the text inside the 2nd combobox does not get empty I want to empty the second combobox so that when a user clicks on a different item in the first combobox the text inside the second combobox is set to empty

Thanks in advance

Clear combobox list on select

Hi My code is as follows:

<vbox>
  <combobox id="supervisors"  placeholder="${ b:l('str.workload.user_supervisor') }"  model="@load(vm.supervisors)" autodrop="true" selecteditem="@bind(vm.selectedSupervisor)" onselect="@command('showSupervisorUsers')" 
   selectedItem="@bind(vm.selectedSupervisor)" 
   onSelect="@command('showSupervisorUsers')" 
   visible="@load(vm.callCenterManager)">
                    <template name="model" var="user">
                        <comboitem label="@load(user.name)"/>
 label="@load(user.name)"  />
                    </template>
                </combobox>
       <listbox id="listbox_supervisorUsers" selecteditems="@bind(vm.selectedSupervisorUser)" 
          selectedItems="@bind(vm.selectedSupervisorUser)" rows="4" multiple="true"  width="300px" height="300px"  model="@load(vm.supervisorUsers)" checkmark="true">
                    <template name="model" var="user">
                        <listitem label="@load(user.name)"/>
                    </template>
                </listbox>
            </vbox>
            <vbox vflex="1" pack="middle">
                <button label="&gt;" onclick="@command('addUsersToUserGroup')"/>
onClick="@command('addUsersToUserGroup')"/>
                <button label="&lt;" onclick="@command('removeUsersFromUserGroup')"/>
onClick="@command('removeUsersFromUserGroup')"/>
            </vbox>
            <vbox>
      <combobox id="listbox_userGroups"  placeholder="${ b:l('str.workload.user_group') }"  model="@load(vm.userGroups)" autodrop="true" selecteditem="@load(vm.selectedUserGroup, 
        selectedItem="@load(vm.selectedUserGroup, before='clearSelection')" onselect="@command('showUserGroupUsers')" &gt;="" <template="" 
        onSelect="@command('showUserGroupUsers')" >
                    <template name="model" var="userGroup" id="listbox_userGroups_items">
                        <comboitem label="@load(userGroup.description)"/>
label="@load(userGroup.description)"  />
                    </template>
                </combobox>
                <listbox id="listbox_groupUsers" rows="4" multiple="true" width="300px" height="300px" model="@load(vm.groupUsers)" selecteditems="@bind(vm.selectedUser)" selectedItems="@bind(vm.selectedUser)" checkmark="true">
                    <template name="model" var="user">
                        <listitem label="@load(user.name)" disabled="@load(user.disabledUser)"/>
                    </template>
                </listbox>
            </vbox>

</vbox>

When i click on first combobox then the information is displayed on other combobox but when i select again the first combobox the text inside the 2nd combobox does not get empty I want to empty the second combobox so that when a user clicks on a different item in the first combobox the text inside the second combobox is set to empty

Thanks in advance

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