Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Jihad99
New Contributor II

Listbox of type Windows Checkbox: Keep only one selected value after reducing the data.

Hey guys,

I have a listbox of 6 values that the user should only pick one at a time.

I created it as windows checkbox and checked the option "Always One selected value", and thus, everything works fine. However, this doesn't work after reducing the data (Removing the data in order to reduce the size of the QVWs and be able to deploy on multiple environments).

Each time I do that - and in my case, it is a must - I need to check the option "Always One selected value"  AFTER RELOAD to make it windows checkboxes, and I guess this is not the best practices. 

Using triggers, I was able to select default value on open, however, I need it to be unique and therefore, check the above option in the list box. this is not working though!!

Any help would be highly appreciated.

Thanks,

4 Replies
Jihad99
New Contributor II

Re: Listbox of type Windows Checkbox: Keep only one selected value after reducing the data.

Apparently, when you remove the data from a qvw, the selected option in lisbox are disabled and this is a bug I guess.

Support
Support

Re: Listbox of type Windows Checkbox: Keep only one selected value after reducing the data.

Things are working as expected, this is not a bug, what you must have in this case is a common value that remains for all users, or things will not work with Always One Selected.  Publisher is trying to reselect the value that was selected prior to the data reduction and if it cannot, what you see is the result of that, so in order to have things work as you expect, you will need a value that exists for all users and that should be the value that is selected when you save the app to the Source Documents location for Publisher to reload from.  You should be able to test this to confirm I am correct, but the last time I checked upon this years ago now, this was the explanation and the engineers deemed it to be working as expected.

Regards,
Brett

To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.
Jihad99
New Contributor II

Re: Listbox of type Windows Checkbox: Keep only one selected value after reducing the data.

Thank you for your reply. 

The problem with the listbox is that It represents an inline table created in the load script in the reload process. so when you reduce the data, the listbox disappeares from the sheet. What I need to do is to make this list static or embedded inside the qvw regardless of the data and this was the hard part.

The turnaround for that is to create 2 triggers: one to select the default value (Select in field) and after selecting it creates another trigger to make it unique. it is working now, but not the best solution for sure, that's why I didn't post the solution here.

Trigger code:

Sub AlwaysOneSelectedValue
set hosp=ActiveDocument.GetField("Dimension")
hospSel=hosp.GetSelectedValues.Count
if hospSel=1 then
set prop = hosp.GetProperties
prop.OneAndOnlyOne = true
hosp.SetProperties prop
end if
End Sub

 

Support
Support

Re: Listbox of type Windows Checkbox: Keep only one selected value after reducing the data.

Sorry about that, here are a couple of places that might give you some further ideas, Rob's site has quite a bit of stuff, he is frequent contributor here as well:

https://qlikviewcookbook.com/

Below is link to the Design Blog area on Community, this is where some of our development gurus have posted how-to's on a bunch of different topics, one of those may have something that will help you out a bit more as well.  Sorry I was not able to do more for you.

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

There are hundreds of posts at this point, so it can be a bit daunting to find what you want, just FYI! 🙂

Cheers,
Brett

To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.