Announcement Announcement Module
Collapse
No announcement yet.
Nasty binding issue ... can this be done? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Nasty binding issue ... can this be done?

    OK, I have extreme respect for anyone who can suggest a neat way to do this in Spring.

    I am using the wizard controller to populate a master object ServiceRequest. ServiceRequest looks a bit like this

    class ServiceRequest {
    Calendar requestDate;
    CorporateWorker source;
    List<Service> services = new ArrayList<Service>();
    ...
    }

    Step 1 binds a text field to the requestDate. Step 2 of the wizard binds a variety of text fields to source.name, source.email and so on. So far so good.

    The issue arises in Step 3. Service has 2 subclasses, InstallationService and TrainingService. I'd like Step 3 to have a pick list for Installation and Training. Depending on what a user chooses, JavaScript will reveal/hide other fields relevant to that type of service (in addition to all the standard Service attributes).

    How do I approach this in Spring. What I am after is to have Spring look at the pick list and instantiate a subclass of the appropriate type, and then to bind the request as best it can to the subclass. Finally, it should add the subclass instance into the master ServiceRequest services collection.

    A big ask? I don't know. I am hoping someone out there does

  • #2
    See my post in this thread - http://forum.springframework.org/showthread.php?t=19976

    With some modification I suspect that technique will work quite well for what you want.

    Bob

    Comment

    Working...
    X