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.
Solved! Go to Solution.
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
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...
Yes you are right, thank you to move it to the BPM service
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
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 )
Can someone please help here ??
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.