PDA

View Full Version : Can't get Spring form binding with subclasses to work!



theone
Sep 7th, 2004, 10:52 AM
tried the same thing as this thread suggested
http://forum.springframework.org/showthread.php?t=9850. I added custom edtior. It still doesn't work for me. I found a post on the web dated in July 30, 2004 saying there was an issue with registering Property edtior. Changes do not get propagate down to the lower class.

http://article.gmane.org/gmane.comp.java.springframework.rcp.devel/179

My question is do I have the latest and greatest from Spring?

I'm running Spring IDE plugin for Websphere
org.springframework.ide.eclipse.beans_1.0.3
org.springframework_1.0.2

How do I know if that changes are in the version of plugin I'm running?

What am I trying to do is very straightforward...

Binding a form with an object EditUser with subclasses: User, Member & Group...

<spring:bind path="editUser.user.firstname">
<input type="text" name="firstname" value="<c:out
value="${status.value}"/>"/>
</spring:bind>

The changes from the form is not get to my User Object.

If I bind the form directly to User like this: And it works fine

<spring:bind path="user.firstname">
<input type="text" name="firstname" value="<c:out
value="${status.value}"/>"/>
</spring:bind>

Some body help...

thomasvdv
Sep 7th, 2004, 01:36 PM
Seems like you pass the User object instead of the EditUser object as your command object to the form

theone
Sep 7th, 2004, 02:47 PM
I did pass the EditUser Object as the command class...

olivier
Sep 9th, 2004, 12:05 PM
Try to use the ${status.expression} for the name parameter of your html tag.



<spring&#58;bind path="editUser.user.firstname">
<input type="text" name="<c&#58;out
value="$&#123;status.expression&#125;"/>" value="<c&#58;out
value="$&#123;status.value&#125;"/>" >
</spring&#58;bind>


[/code]