Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jagannalla
Partner - Specialist III
Partner - Specialist III

listbox should be blocked except one data

Hi,

I've two listboxes. When i select first listbox the other listbox should be blocked except one data.

For eg:

first listbox look like this:

First:

  • A
  • B
  • C

second listbox look like this:

Second:

  • X
  • Y
  • Z

- Now when i select any one in the first listbox the second listbox should be blocked except Y.

How can i overcome this can anyone help me..

6 Replies
Not applicable

Hi,

What if user don't see the excluded values in second list box

if that is ok with you then go to Properties -> General in second list box and check hide excluded.

User can not see the excluded values in second and also can not select from excluded.

HTH

swuehl
MVP
MVP

Not the full solution, but I tried with document triggers like in attached file. Still having some limitations, but you may want to have a look.

I also tried with a calculated expression in a listbox, but got some strange behaviour, nothing I want to share yet..

Regards,

Stefan

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Swuehl,

Thanks for your help..But when i unselect first lisbox and trying to select 2nd listbox with all contents it is not selecting. How can i select all contents in 2nd listbox. Now your application allows to select only one in the second listbox if i remove Hide excluded.

Can you help me on this little bit.

swuehl
MVP
MVP

Please try attached

I replaced the search string in the trigger with

=if(GetSelectedCount(ListA),'Y', '('&replace(GetFieldSelections(ListB),', ','|')&')')

Regards,

Stefan

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

In application also it is not working...

Uncheck Hide exclude and try to select all contents of listB.

But i got solution..

Steps:

1. I checked Show alternative for first listbox.

2. I had taken two buttons to select and deselect the second listbox.

3. In first button i written actions like:

          SelectExcluded ---> FieldName    

          SelectinField     ---->FieldName     and value as Y

          LockField          -----> FieldName

4. In second button i written actions like:

          UnlockField  ---->  FieldName

           Macrocode -----> To clear the fieldname

swuehl
MVP
MVP

Well, If I deselect ListA  values, I am able to select one, two or all values from ListB.

(tested with QV 10 SR2, with above attached application).

I can do this with option "Hide excluded" checked or unchecked.

But good if you have a working solution.

Edit:

Do you have any links between these two fields?

edited by swuehl