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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Clear selection in listbox on leaving sheet (option 'Always one selected value' is checked)

Hello all, I have a sheet in that sheet there's a listbox where I always have to select one element (option 'Always one selected value' is checked). When I leave this sheet and go to another one, I want to be able to clear te selection. In this other sheet this listbox is not present.

The main problem is that on one sheet I just want to select one element and on the other one's I want to selct no, one ore more elements of the same field

I have already tried the sheet even triggers actions like 'Clear all' an 'Unlock All'

See example!

Can anyone help me out here, Thnx in advance!

9 Replies
stigchel
Partner - Master
Partner - Master

You can trigger a macro (action/external/run macro) that has the followinfg code:

sub ClrSel

          Set fld = ActiveDocument.GetField("Field")

          Set prop = fld.GetProperties

          prop.OneAndOnlyOne=False

          fld.SetProperties prop

          Fld.Clear

end sub

Piet Hein

kji
Employee
Employee

Always one value selected is a field setting, not just applicable to a single listbox, you would have to change this to be able to clear the selection.

Not applicable
Author

Does this also work on the web front-end?

stigchel
Partner - Master
Partner - Master

I think it does not work in Ajax, not sure about the plugin.

Not applicable
Author

Is there a setting that applies to an object in stead of a field to achieve the same result?

Not applicable
Author

Then it's not a solution to my problem

Not applicable
Author

I think you may want to detach via the script the field to that you have the field twice once auto selected for one sheet and not for another.

LOAD DISTINCT

          field1,

          field1 as field2

RESIDENT Report;

tduarte
Partner - Creator II
Partner - Creator II

cjwhit,

If you do that then wouldn't you have only one possible value on the second field anyway?

christophebrault
Specialist
Specialist

Hello,

Perhaps you could find an other way to this problem.

Clearly, the option 'Always one selected value' is a problem.

With triggers you select one value when visitor arrive and then clear the selection when he leaves.

Then you can pop up a message when more than 1 value is selected or none.

Look at the file,

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin