AnsweredAssumed Answered

custome form type values are null

Question asked by cutout33 on Jul 3, 2013
Latest reply on Jul 4, 2013 by frederikheremans1
Hi,

am trying to create my own type


public class UserListFormType extends AbstractFormType {

   protected Map<String, String> values;
   
   public UserListFormType(Map<String, String> values) {
      this.values = values;
   }

   @Override
   public Object getInformation(String key) {
      if (key.equals("values")) {
         return values;
      }
      return null;
   }

   public static final String TYPE_NAME = "user_list";

   @Override
   public String getName() {
      return TYPE_NAME;
   }

   @Override
   public Object convertFormValueToModelValue(String username) {
      // TODO get the user object
      return username;
   }

   @Override
   public String convertModelValueToFormValue(Object lookup) {
      if (lookup != null) {
         return ((LookupModel) lookup).getKey().toString();
      }
      return null;
   }

}

I took the code fro enum form type, but the values are always empty if I use map constructor and null if I use empty constructor.
in my spring
   <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">

      <property name="customFormTypes">
         <list>
            <bean class="com.aurorarnd.gxt.api.bpmn.types.UserListFormType">
               <constructor-arg name="values">
                  <map></map>
               </constructor-arg>
            </bean>
         </list>
      </property>

   </bean>

Outcomes