08-28-2017 08:19 AM
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.
08-29-2017 06:41 AM
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
08-28-2017 08:43 AM
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...
08-28-2017 08:46 AM
Yes you are right, thank you to move it to the BPM service
08-29-2017 06:41 AM
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
08-29-2017 07:00 AM
Thank you Chemsseddine it is perfectly running in my code !
Really appreciated
11-29-2019 04:43 AM
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 )
12-01-2019 09:13 AM
Can someone please help here ??
Explore our Alfresco products with the links below. Use labels to filter content by product module.