Dropdown in dynamic table

cancel
Showing results for 
Search instead for 
Did you mean: 
aextractor
Active Member

Dropdown in dynamic table

Jump to solution

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 Solution

Accepted Solutions
bhchemss
Established Member

Re: Dropdown in dynamic table

Jump 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

View solution in original post

6 Replies
afaust
Master

Re: Dropdown in dynamic table

Jump to solution

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
Active Member

Re: Dropdown in dynamic table

Jump to solution

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

bhchemss
Established Member

Re: Dropdown in dynamic table

Jump 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

aextractor
Active Member

Re: Dropdown in dynamic table

Jump to solution

Thank you Chemsseddine it is perfectly running in my code !

Really appreciated Smiley Happy

ajindal10
Customer

Re: Dropdown in dynamic table

Jump to solution

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
Customer

Re: Dropdown in dynamic table

Jump to solution

Can someone please help here ??