Announcement Announcement Module
Collapse
No announcement yet.
Advanced property-editor ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Advanced property-editor ?

    I have an Enum with 5 elements. Further I have a map where the enums is used as keys. This map is persisted via serialzation.

    I want the web-form to be created with this map and use a property-editor to parse values back into the map.

    The enum's label will be used to pick the right message for labeling the fields on the web.

    How would I write this Property-editor, and how would I bind it in Spring to make Spring return a populated map to my controller ? What would be the form:path-values ?

    Sample :

    Code:
    	public static enum InfoDetail {
    		account,phone,fax,mail,web,adr1,adr2;
    		
    	}
    
    ...
    
    Map<InfoDetail, String> data;
    First time I would just iterate through the enums and put an empty string for each key into the map and put it into the model.

    If I later were to add fields in the enum, I would also just add those to the retreived map, in order to make the fields avaialbel for editing on the web-page.
    Thus the web-page could really be just dynamic and iterate over the keys in the map.

    /frode
Working...
X