cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown in dynamic table

aextractor
Champ on-the-rise
Champ on-the-rise

Hi,

i am trying to set values in a dropdown field in a dynamic table depending on conditions using Script task. For string fields i usually use the folllowing line in my code:

tab_2.push({ident:tab_1[i].ident,value:'Yes'})

In here 'ident' (string) is the first column and 'value' (string) is the second in my dynamic table named 'tab_2'. In this case the code is running and the table is fulfilled. The problem is when trying to change 'value' as dropdown with options (Yes, No), that way the value field remain empty.

Is any body has an idea about how to set values to a dropdown field in a dynamic table using javascript ?

Thank you in advance for your support.

1 ACCEPTED ANSWER

bhchemss
Star Contributor
Star Contributor

Hi Haboubi,

You only need to reference your dropdown id property to an object that contains a property name that will hold your value which is the option predefined in the columns of your table like this :

tab_2.push(
{
"dropdown_id":{"name":"option_1"}, //if you want to choose option 1 of the dropdown
...
}
)

Hope this help

Cheers

Chemss

View answer in original post

6 REPLIES 6

afaust
Legendary Innovator
Legendary Innovator

Are you talking about the dynamic feature of the Alfresco Process Services product? If so, this post should probably belong in the Process Services space. Let me know and I will move it...

aextractor
Champ on-the-rise
Champ on-the-rise

Yes you are right, thank you to move it to the BPM service

bhchemss
Star Contributor
Star Contributor

Hi Haboubi,

You only need to reference your dropdown id property to an object that contains a property name that will hold your value which is the option predefined in the columns of your table like this :

tab_2.push(
{
"dropdown_id":{"name":"option_1"}, //if you want to choose option 1 of the dropdown
...
}
)

Hope this help

Cheers

Chemss

Thank you Chemsseddine it is perfectly running in my code !

Really appreciated Smiley Happy

ajindal10
Champ in-the-making
Champ in-the-making

I am new to Alfresco activiti. I am not able to push  my code to dynamic table. My problem statement is I have some list of Json(which I have in one of my script task i.e. is in groovy) which I need to populate to Dynamic table. I set that Json variable in execution. Now on my activiti form in javascript I am trying to display value for that I have written some sample piece but no luck


var test_json=task.getVariable("test_json");   (this is not working can you suggest how to read varibale in javascript)
alert(test_json);

var labelIDJson=scope.findFormFieldWithId(scope.allFormFields, 'label1')  (label1 is my table ID)

var execID=labelIDJson.columnDefinitions[0].id;  (getting column ID's) 
alert(execID);

labelID.push({execID:'no',wfmName:'yes'});   (not working )

ajindal10
Champ in-the-making
Champ in-the-making

Can someone please help here ??