Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need always have a selected value from a listbox without using the properties "Always one selected value".
This is possible?
Thanks,
César
Cesar,
There is an macro command for AlwaysOneSelected listed in the Qlikview API guide the example usage is:
set flddescs = ActiveDocument.GetFieldDescriptions
for i = 0 to flddescs.Count - 1
fdesc = flddescs(i)
if fdesc.AlwaysOneSelected then
msgbox(fdesc.Name & " is in always-one-selected-mode")
else
msgbox(fdesc.Name & " is not in always-one-selected-mode")
end if
next
It doesn't apply directly to your situation but you may be able to adjust it accordingly.
All the best,
Matt
@QlikviewBI
Thaks Matthew but the macro command not run in the web.
You could potentially make use of triggers to limit your selection in list boxes to one selected value. I remember some posts in the past that handled it that way.
But why can't you just use the 'always one selected value' option?
I had the same issue where I wanted the "Always one Selected value" behaviour, but did not want to have that option ticked in the list box settings. I also did not want to use macros.
To solve it, I created a "On Change" Document level trigger for the FIELD in question - ie each time the field changes, a trigger is activated. You can define what this "trigger" is to suit your needs, but I set it to select a predefined value/values in the list box. The result of all of this is that one value will always be selected.
Dear Matthew,
Can You Please Briefly Explain How to Use the macros? or send me one test file please.
Thanks & Regards,
Nirmal.
Could I ask why you don't want to use the property, seems like making life difficult without needing to.