Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

field.selectValues button in sense mockup

Hi,

I'm working on a sense mockup where i use customized action buttons.

in my .js file i've written like the example below. The clearAll button works fine, but not the selectValues. (with this I want to select a specific value in a specific field)

Any one has an idea of what could be wrong?

...

var app1 = qlik.openApp('Mikrosegment.qvf', config);

$('#clear').on('click', function(event) { 

   event.preventDefault(); 

   app1.clearAll(); 

});

$('#Q4').on('click', function() { 
app1.field('kvartal').selectValues([{qText:"Q4"}], true, true);  

});

Thanks!

/Pierre

1 Solution

Accepted Solutions
Not applicable

Re: field.selectValues button in sense mockup

Ok,

Now it works kind of auto magical. Seems like it had to be double quotation marks when calling field (id) and selectValues. I'ts the little tiny things that does it! *sigh*

This is a great function allowing you to select and monitor your mockup app in any direction with the design you want

Works great as Div, P, A href, Button... So, no extra extension needed!

HTML:

<div id="mainSegA" class="btn btn-default">Main Segment A</div>

.js:

$("#mainSegA").click(function() {    

    app1.field("Main segment").selectValues([{qText:"A"}], true, true);

  });

5 Replies
erik_wetterberg
Valued Contributor III

Re: field.selectValues button in sense mockup

Hi Pierre,

If 'kvartal' is a numeric field you need the numeric value. Try something like:

   app1.field('kvartal').selectValues([4], true, true);

or perhaps

   app1.field('kvartal').selectValues([3], true, true);


Erik

Erik Wetterberg
https://extendingqlik.upper88.com/
Not applicable

Re: field.selectValues button in sense mockup

unfortunately it is a string...

/Pierre

erik_wetterberg
Valued Contributor III

Re: field.selectValues button in sense mockup

Have you tried to debug this?? Does it manage to find the field (that is does app1.field("kvartal") return a field object)??

Erik

Erik Wetterberg
https://extendingqlik.upper88.com/
Not applicable

Re: field.selectValues button in sense mockup

Ok,

Now it works kind of auto magical. Seems like it had to be double quotation marks when calling field (id) and selectValues. I'ts the little tiny things that does it! *sigh*

This is a great function allowing you to select and monitor your mockup app in any direction with the design you want

Works great as Div, P, A href, Button... So, no extra extension needed!

HTML:

<div id="mainSegA" class="btn btn-default">Main Segment A</div>

.js:

$("#mainSegA").click(function() {    

    app1.field("Main segment").selectValues([{qText:"A"}], true, true);

  });

Highlighted
Employee
Employee

Re: field.selectValues button in sense mockup

guys, do you have an idea what is the syntax in .selectValues method to have a selection based on a formula, not based on a list of constants (field members), something like

myField.selectValues(["=Country LIKE 'A*'"], true, true);

The engine is able to handle this and even the user may enter this in the search icon popup of each listbox.

Community Browser