Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

disable listbox selection based on other listbox selection

Hi gurus,

I do have a requirement where I need to disable list box 2 when list box 1 is selected, I'm able to hide listbox 2 when

listbox 1 is selected using GetSelectedCount function and using conditional function, but I want to show it and disable selection, I know it can be down using Actions and trrigger, can someone please explain how to achieve this.

attaching sample qvw.

Any help is highly appreciated.

9 Replies
rubenmarin1

Hi kumar, I don't know how to disable, as a workaround you can remove selections and hide the list box, to remove selections: in document properties (Ctrl+Alt+D)--> Triggers --> Select the list box1 field in field events --> On Select;add action --> Add --> Selection;Delete field --> In Field text box set the name of the listbox2

JonnyPoole
Former Employee
Former Employee

i avoided locking triggers etc.  and put something a bit more obvious to the user.  (conditional text box that overlays the 2nd list box)

Not applicable
Author

Hi Jonathan,

I liked your solution, also can you please let me know how to disable the listbox selection, I tried to use lock filed trigger, on field selection, but it doesnt work..am I missing anything,

please let me know

disable listbox.PNG

JonnyPoole
Former Employee
Former Employee

I think its because you can't lock a field unless there is a selection in it.

In your case you are trying to lock a field that has no selected value.

Do you want to apply a selection on the resulting 'possible values'  (in white) and lock those ?

Here is an example of doing that with 2 actions fired based on the trigger of a  selection of a value in the first list box.

Not applicable
Author

Hi Jonathan,

Thx for response. I made field selection and still list box doesn't get locked. please help.

JonnyPoole
Former Employee
Former Employee

If the transplanted sample isn't working in your app can you share some screenshots of the actions you creates as well as the expression of the 'select in field' search mask? 

Also do the values have spaces in them ? The sample did not but if your app does then a change is needed

sudeepkm
Specialist III
Specialist III

have you tried making the second list box READONLY. The way you have the conditional visibility of List box 2 based on selection of values in List box 1 same way you ca have the second list box readonly. so that noone can select anything from that list box.

Not applicable
Author

Hi Sudeep,

read only disables the selection of listbox 2 completely, I want to disable the selection only when list box 1 is selected

rubenmarin1

Hi Kumar, Sudeep solution is a good idea, you already know how to hide, you can have two listbox2, one read only and one selectable, when there are selections in listbox1 you can hide the "selectable" listbox2 and un-hide the read-only list box