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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
justinasp
Creator
Creator

Set ListBox properties in macros

Hello, fellows,

could anyone write, how to set AlwaysOneSelectedValue property for the ListBox in macros. Or maybe the Field itself has this option?

Thank's for the help,

Justinas

1 Solution

Accepted Solutions
disqr_rm
Partner - Specialist III
Partner - Specialist III

Yes, it is for the field. The code below will give you an idea. Hope this helps you.


sub a
set fld=ActiveDocument.GetField("Product")
if fld.GetValueCount(1) <> 1 then
msgbox "Please select one value first"
exit sub
end if

set fprop = fld.GetProperties
fprop.ShowAlternatives = false
fprop.OneAndOnlyOne = true
fld.SetProperties fprop
end sub


View solution in original post

3 Replies
disqr_rm
Partner - Specialist III
Partner - Specialist III

Yes, it is for the field. The code below will give you an idea. Hope this helps you.


sub a
set fld=ActiveDocument.GetField("Product")
if fld.GetValueCount(1) <> 1 then
msgbox "Please select one value first"
exit sub
end if

set fprop = fld.GetProperties
fprop.ShowAlternatives = false
fprop.OneAndOnlyOne = true
fld.SetProperties fprop
end sub


Not applicable

Consulta

Como se aplica este script?

Desde donde se ejecuta el llamado?

Gracias .-D

Not applicable

Hi,

If your requirement is to select one value always, this will help you.

1. Select any value in the listbox

2. Go to the properties of that listbox

3. On the General Tab, find the option "Always One Selected Value"

4. Mark it as enable.

5. Click on "Apply" and "Ok"

This process will enable you to select one value always from that listbox, untill you mark it as disable.

No changes will take place even you click on "Clear" button.