-
Dec 8th, 2005, 10:43 AM
#1
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
-
Dec 8th, 2005, 03:50 PM
#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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules