1. For every selection in the application that will trigger a repaint of any objects and your extension.
2. I would recommend that you do not lock this down as it could have some severe implications to how QS works.
Now what I would recommend is that you can lock selections. Locked fields will still be locked after a Clear Selections event or other selections in other fields.
The user will still be able to un-lock any locked fields BUT if they do so most likely it will be for a good reason
See https://help.qlik.com/sense/en-us/developer/index.html#../Subsystems/Workbench/Content/BuildingWebsites/API/Methods/lock… for more information on how to lock a field.
1. This is what I thought, but this is not repainting. May be there is some issue with calling the selectValues() method, though i did not notice any in debug window. Any clue?
2. I do not want to lock the selected values. I want the values other than the selected ones should be disabled or unavailable for selection. So if there are two items selected, then user should be able to select any of these two only. Selecting any other option should not change data.
Hmm, there won't be a good way of achieving that. The only way would be to lock selections.
It sounds like you want to create a drill-path which must start at the top? Qlik by nature is not build like the old traditional olap cubes.
And you can't use set analysis to only include certain fields in your calculation?
Another option might be to use a different state, then your extension won't be affected by selections in the normal app.