I am retrieving data from a datasource like this:
VALUE | LABEL
-------+-----------
'ES' | 'Spain'
'IT' | 'Italy'
'FR' | 'France'
... | ...
I want my Check Component to show values on the label column, but use values on the value column instead as the component's own Parameter's value, so if a user selects 'Spain', my countries
parameter adds 'ES'
to the list of countries. It has to end up being something like this:
<input ... value="ES">
<label ...>Spain</label>
So far, I know if I provide a static list on the . But I can't figure out how to achieve the same thing via my dynamic datasource.Values array
property for the component, this will work
Please don't suggest to hack it after rendering with some jQuery or the like, I want to know if Pentaho CDE provides a way to do this properly.
Update: Providing a static list won't work. No matter what you put on the Arg
and Value
columns, only the Value
will be used. But I found out why, and I wrote the answer :)
I found the answer, just in case someone falls into the same dumb mistake.
There is an option for the component, called
Value as Id
. When set asfalse
, provided there are two columns on the datasource for this component, the first column will be used asvalue
for the checkbox input, and the second column will be used as text for thelabel
element.So my original dataset worked when I set
Value as Id
asfalse
.