How to get the valueof dropdown

cancel
Showing results for 
Search instead for 
Did you mean: 
akanksha
Member II

How to get the valueof dropdown

Jump to solution

Using Activiti designer, how can I get the value I am selecting in the dropdown. If i write ${id of the field} in the documentation  i get the id of the option selected in the dropdown and not its value.

1 Solution

Accepted Solutions
gdharley
Intermediate

Re: How to get the valueof dropdown

Jump to solution

Ok, so the devil is always in the detail.

If you are using the sample activiti-explorer VAADIN application, the label of the dropdown is not saved to the process variable.

Obviously the easiest option would be to have the id and label match.

If that's not an option, then you can overload the org.activiti.engine.impl.form.DefaultFormHandler class.

Greg

View solution in original post

8 Replies
gdharley
Intermediate

Re: How to get the valueof dropdown

Jump to solution

Did you try the "name" attribute of the field? Likely this is what you are looking for.

Greg

akanksha
Member II

Re: How to get the valueof dropdown

Jump to solution

Hi Greg Harley,

Yes, I tried with "name" attribute but it is showing error "Error in parsing"

gdharley
Intermediate

Re: How to get the valueof dropdown

Jump to solution

Works for me, perhaps you can attach a test case.

akanksha
Member II

Re: How to get the valueof dropdown

Jump to solution

Can you please send me the screenshot of how you did it.

gdharley
Intermediate

Re: How to get the valueof dropdown

Jump to solution

Screenshot of form editor screen (notice I have attached to the form value changed event)

Here is the code to retrieve and alert the name and id for the selector:

var thisUn1 = scope.findFormFieldWithId(scope.allFormFields, 'selector').value;
alert("name :" + thisUn1.name + "id:" + thisUn1.id);

Regards,

Greg

akanksha
Member II

Re: How to get the valueof dropdown

Jump to solution

In this you have created your own form but I am using activiti explorer and using their form property only. I am not using any event. In activiti there is a form property type called enum, I want to display the value in the documentation box of next user task which I am selecting in the dropdown. If in documentation I write ${id of the enum field}, I get the id of the dropdown option selected and not its value.

gdharley
Intermediate

Re: How to get the valueof dropdown

Jump to solution

Ok, so the devil is always in the detail.

If you are using the sample activiti-explorer VAADIN application, the label of the dropdown is not saved to the process variable.

Obviously the easiest option would be to have the id and label match.

If that's not an option, then you can overload the org.activiti.engine.impl.form.DefaultFormHandler class.

Greg

akanksha
Member II

Re: How to get the valueof dropdown

Jump to solution

Ok.. thank you soo much.