Form select widget value

1
0
-1

Bonita BPM Community Edition Version : 6.3.1

Hello,

Is it possible to set another value than the value which is showed in the select widget. like:

<option value="Bar">Bar</option>

becomes:

<option value="foo">Bar</option>

if it is possible how would i look like in the script for available values? today the script is like this: ["Bar", ...] i think it should look like this: ["foo"=>"Bar", ...]

2 answers

1
0
-1
This one is the BEST answer!

i found it by my self in the groovy tutorial: http://groovy.codehaus.org/Tutorial+1+-+Getting+started

Insted of:

["foo"=>"Bar", ...]

it is:

["Bar":"foo"...]
["what the option show":"the value you gonna get"...]

1
0
-1

Hi, Yes, it is possible. You can do that by using a HashMap. For exemple, I create this map :

HashMap<String, String> map = new HashMap<String, String>();
map.put('foo', 'bar');
map.put('one','un');
map.put('two','deux');

Then, I my the output of widget, I put the script :

return map.get(field_MyWidget);

If I enter 'foo' in the widget, it will return 'bar'. If I enter 'one', it return 'un'. etc ...

Notifications