cancel
Showing results for 
Search instead for 
Did you mean: 

BooleanFormPropertyRenderer

nico1
Champ in-the-making
Champ in-the-making
I'll get onto raising a bug report, but this is just to note that there is an apparent bug in this class in both 5.8 and 5.9, here is the fix:


@Override
  public Field getPropertyField(FormProperty formProperty) {
   
    CheckBox checkBox = new CheckBox(getPropertyLabel(formProperty));
    checkBox.setRequired(formProperty.isRequired());
    checkBox.setEnabled(formProperty.isWritable());

    if (formProperty.getValue() != null) {
      Boolean value = new Boolean(Boolean.parseBoolean(formProperty.getValue())); // bug fix
      checkBox.setValue(value);
    }

    return checkBox;
  }

This is the Exception fixed:


Caused by: java.lang.IllegalArgumentException: CheckBox only accepts Boolean values
        at com.vaadin.ui.Button.setInternalValue(Button.java:546)
        at com.vaadin.ui.AbstractField.setValue(AbstractField.java:493)
        at com.vaadin.ui.AbstractField.setValue(AbstractField.java:451)
        at org.activiti.explorer.ui.form.BooleanFormPropertyRenderer.getPropertyField(BooleanFormPropertyRenderer.java:39)
        at org.activiti.explorer.ui.form.FormPropertiesComponent.setFormProperties(FormPropertiesComponent.java:69)
        at org.activiti.explorer.ui.form.FormPropertiesForm.setFormProperties(FormPropertiesForm.java:75)
        at org.activiti.explorer.ui.task.TaskDetailPanel.initTaskForm(TaskDetailPanel.java:306)
        at org.activiti.explorer.ui.task.TaskDetailPanel.init(TaskDetailPanel.java:118)
        at org.activiti.explorer.ui.task.TaskDetailPanel.attach(TaskDetailPanel.java:99)
        at com.vaadin.ui.AbstractComponent.setParent(AbstractComponent.java:570)
        at com.vaadin.ui.AbstractComponentContainer.addComponent(AbstractComponentContainer.java:211)
        at com.vaadin.ui.GridLayout.addComponent(GridLayout.java:223)
        at org.activiti.explorer.ui.AbstractPage.setDetailComponent(AbstractPage.java:137)
        at org.activiti.explorer.ui.task.TaskPage.access$000(TaskPage.java:44)
        at org.activiti.explorer.ui.task.TaskPage$1.valueChange(TaskPage.java:116)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:490)
        … 44 more
2 REPLIES 2

cweber
Champ in-the-making
Champ in-the-making
Does this get fixed for activiti 5.10?

frederikherema1
Star Contributor
Star Contributor
Yup, just fixed it on trunk.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.