Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Author

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);

  });

View solution in original post

5 Replies
ErikWetterberg

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

Not applicable
Author

unfortunately it is a string...

/Pierre

ErikWetterberg

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

Erik

Not applicable
Author

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);

  });

ChristofSchwarz
Partner Ambassador
Partner Ambassador

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.