Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Listbox Show Condition with AJAX

Hi,

I have a few listboxes which have different show conditions. These show conditions are variables that I define in my loadscript. Everything works as expected in the .qvw and the list boxes appear and disappear as expected.

However, when I view the document in AJAX this behaviour isn't replicated, once a listbox disappears it never seems to appear again. I've had a look at the HTML and it seems to set the display to none and this doesn't seem to get undone in the HTML when it should and does in the .qvw

Is there some kind of bug with show conditions with .qvws in AJAX? As I really can't seem to get my head around why it doesn't work. 

Labels (7)
8 Replies
rubenmarin

Hi, I have used text boxes with show conditons based on variables loaded in script and it works, so most probably is something else.

Just guessing: Maybe variables are calculated using field values that are not available because of section access?

There are also some triggers, wich are the conditions to show the text box again?
Anonymous
Not applicable
Author

So I have a listbox with a "Mode" selection.

My variables are defined as the following:

SET vShow1 = IF(MODE_KEY = 2, 1, 0);
SET vShow2 = IF(MODE_KEY = 1, 1, 0);
SET vShow3 = IF(MODE_KEY = 2, 0, 1);
SET vShow4 = IF(MODE_KEY = 2, 1, 0);

My Section Access is defined as the following:

LOAD DISTINCT
                               UPPER(USER) AS NTNAME
                               ,'ADMIN' AS ACCESS

What is rather odd is that making a selection in the "User" field can trigger the listboxes to reappear, but making a selection in the "Mode" field doesn't cause the triggers to reappear. As I said, I don't replicate any of these issues directly on the .qvw itself but I do experience them when it is looped, reduced and section-accessed via AJAX. 

rubenmarin

In access point all users access as 'USER' not 'ADMIN', one common issue is the different behaviour because a field value can be accessed in desktop (having ADMIN access type) but in access point, with USER access type, the value is not available.

Can you temporary disable/comment section access to confirm/discard this as the cause of the issue?
Anonymous
Not applicable
Author

Hi,

Thanks for the help.

I commented out all of Section Access, reloaded, looped and reduced.

However I am still getting this issue so I think we can discard this as the cause of the issue. There are certain situations where I can seem to trigger the listbox to reappear.

The listboxes show conditions are entirely dependent on the "Mode" selection made by the user. However some users have access to multiple users and when making a selection in the "User" selection, the listboxes seem to be triggered to appear as usual, which I find quite unusual and seems to point to the ShowCondition not being consistently evaluated on selections. The real issue here is that making a selection in "Mode" doesn't reappear the listboxes as it does in the .qvw. 

rubenmarin

Another guess: Maybe MODE_KEY is storing diffrent values (each user has a different value) so MODE_KEY =Null()

Adding a textbox to show the value of MODE_KEY can help to follow what is doing.

You can also test show condition to be consistent using a simpler text boxes with buttons to directly set variable values to 1 or 0, without checking field values.
Maybe it's a bug in the version you are using but in my experience if show condition evaluates to true the object is shown, it's consistent on that.
Anonymous
Not applicable
Author

Hi,

I did try inspecting this. Mode can only ever be 1,2 or 3. And I traced that Mode matched to what it should do. It just seems to be something in the way AJAX along with this .asp file is driving the workbench for this since it works perfectly fine on the .qvw side but not on the web via AJAX and .asp. And since we've ruled out Section Access, I think my only solution might be to write some javascript that works off of the same logic to make it work in the workbench.

cwolf
Creator III
Creator III

Because MOD_KEY is a field, you need an aggregation in your conditions, for example:

SET vShow1 = IF(Max(MODE_KEY) = 2, 1, 0);

- Christian

Anonymous
Not applicable
Author

Hi,

I tried this with the MAX and the issue remains.

Thanks,

Jamie