cancel
Showing results for 
Search instead for 
Did you mean: 

ComboBox Change listener

kingbee888
Champ in-the-making
Champ in-the-making
Hi All,

I created multiple custom Form Types that are combo boxes and I need to change the data of one based on the value of another but I'm not really sure how to do so.  I know that I have to implement the addListener(new Property.ValueChangeListener()  method but how do you reference the other custom Form type?  Or will I have to create a custom field that contains all the comboboxes? 

If someone can point me to an example on how to implement this, that would be great.


Thanks,
Bee
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
The second indeed would need to depend on the first one and add a value change listener.

Renderers of form types are defined in the activiti-ui-context.xml:

<code>
<property name="propertyRenderers">
      <list>
        <bean class="org.activiti.explorer.ui.form.StringFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.EnumFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.LongFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.DoubleFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.DateFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.UserFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.BooleanFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.ProcessDefinitionFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.MonthFormPropertyRenderer" />
      </list>
    </property>
</code>

Adding your custom type there that depends on the other is done there.

ejyanezp
Champ in-the-making
Champ in-the-making
Hello,

Ok, this may answer the question, going with the second option of building a custom component with all the combos. But this is, honestly speaking,  unnatural.

Suppose, for example, I have a form for booking a travel in a yacht, and depending on the count of passengers, the maintenance status and the availability of the company boats the yatch combo is filled, do i have to put all the passenger count, status and booking dates fields all of them in a single custom component?

What do we have to do to change this?

Regards,
Eduardo Yánez.

ejyanezp
Champ in-the-making
Champ in-the-making
Hi kingbee888, look at this link, and tell me there if that works for you

http://forums.activiti.org/content/activiti-forms-dependent-properties

Regards,
e.