Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Viven
Contributor
Contributor

locking listbox

Please look at my attached qvw. 

As you can see my listbox box displays 1 checkbox. When the 'Made in usa' checkbox is selected, the tablebox updates correctly with car_id 5.

The problem arises when the dataset changes and contains no vehicles from usa. Remove line 5 from the inline load to test. Now that there is no values associated to usa I'd like my checkbox to be greyed out and locked. I'm sure that can be done with a trigger but I need assistance with this please.

4 Replies
Lisa_P
Employee
Employee

Another way of doing this is deriving the second table from the first table and rather than creating inline, create another table like this:
Cars:
load car_id, manufacturer, origin inline [
car_id, manufacturer, origin
1,toyota, japan
2,volvo, sweden
3,bmw, germany
4,honda, japan
6, kia, korea
7, vw, germany
];

Select:
Load origin,
'Made in '&origin as Select
Resident Cars;

Select can now be your list box to select the origin countries
Viven
Contributor
Contributor
Author

Thanks for your response Lisa.

However I need the listbox to work as I have specified previously. There will always be a specific country that I checking for to derive this list box. And if that country is not available in the dataset, I still need the entry Made in usa to be available. Only difference is that I need the listbox greyed out and locked. Can you should be how this can be done using a trigger or macro?

 

Lisa_P
Employee
Employee

Hi Viven,

If you make selections in car_id, manufacturer or origin this behaviour will happen automatically, is this not enough ?

VivenReddy
Partner - Creator
Partner - Creator

Yes you are correct. Making another selection does grey out the checkbox. However the user is still able to uncheck it - which we do not want the user to be able to do when usa cars are not in the dataset. Therefore I thought that a trigger or macro is required. It needs to first check the data. If usa vehicles exists in the dataset then do nothing else grey out the list box and lock it so that it cannot be unchecked.

Is this at all possible?