Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to disable multi-select in list box

Hi all, I am greener of qlikview, Currently facing a problem as subject, I can't find a solution to disable multi-select in list box. We all kown that we can tick the option 'Always one selected value' in the list box property, tab 'General'. But it also bring side effort that make us can't implement unselect operation.

Does any one know how to only disable multi-select in a simple way? Really thx!

1 Solution

Accepted Solutions
kuba_michalik
Partner - Specialist
Partner - Specialist

You don't really need a macro.

Set up a trigger for a field on an OnSelect event (Settings -> Document Properties -> Triggers). For field FIELD set up Selection -> Select in Field -> use =Only(FIELD) as Search String. Now if somebody selects one value, it gets selected, if somebody selects more than one - all get deselected immediately after.

EDIT: I'm including a quick example

View solution in original post

7 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Select a single option and check properties, Now this option is enable.

Regards,

jagan.

ekech_infomotio
Partner - Creator II
Partner - Creator II

Hi Paul,

is it right that you sometimes want "Always one selected value" and sometimes not?

AFAIK it is only possible via macro -  you will need two subroutines:

sub set_singlevalue

'please notice that you have to select a value before the option can be set

          activedocument.fields("yourfieldname").select "yourdefaultvalue"

          set fYOURFIELDNAME = activedocument.getfield("yourfieldname")

          set prop = fYOURFIELDNAME.getproperties

          prop.OneAndOnlyOne = true

          fYOURFIELDNAME.SetProperties prop

end sub

sub set_multivalue

  set fYOURFIELDNAME = activedocument.getfield("yourfieldname")

  set prop = fYOURFIELDNAME.getproperties

  prop.OneAndOnlyOne = false

  fYOURFIELDNAME.SetProperties prop

end sub

then create two buttons (or text-objects) and set "EXTERNAL" ==> "Run Macro" as Action - one with set_multivalue and one with set_singlevalue.

please notice that you have to select a value before

regards,

Edgar

Not applicable
Author

thx for reply, but problem is that option is only for 'always select one value', which can't fullfill the requirement the situation of select none of them. Now my biz requirement is as below:

1.can select one value

2.can select none of the value

3.can't select multi-value

Do you know how to implement it?

Not applicable
Author

THX edgar, seem this micro still can't fix the problem o. maybe I didnt descript well.

This problem is: I can't select multi velue like below snapshot

========

A(selected)

B(selected)

C(un-select)

========


But i need impletement below 2 kinds of situations.

=========

A(selected)

B(un-select)

C(un-select)

=========

and

=========

A(un-select)

B(un-select)

C(un-select)

=========

kuba_michalik
Partner - Specialist
Partner - Specialist

You don't really need a macro.

Set up a trigger for a field on an OnSelect event (Settings -> Document Properties -> Triggers). For field FIELD set up Selection -> Select in Field -> use =Only(FIELD) as Search String. Now if somebody selects one value, it gets selected, if somebody selects more than one - all get deselected immediately after.

EDIT: I'm including a quick example

Not applicable
Author

Really thx Kuba. It works perfect:)

ekech_infomotio
Partner - Creator II
Partner - Creator II

cool. didn't know until now 😉