Thanks for the replies Mike.
Two issues with the below is that it doesn't seem to like me using
spring:form. Everything else seems to be form:form which seems to work.
I therefore tried the below using form:select, and I get the following
exception:
java.lang.NullPointerException
at
org.springframework.web.servlet.tags.form.SelectedValueComparator.exhaustiveCompare(SelectedValueComparator.java:154)
at
org.springframework.web.servlet.tags.form.SelectedValueComparator.isSelected(SelectedValueComparator.java:90)
at
org.springframework.web.servlet.tags.form.OptionWriter.isSelected(OptionWriter.java:184)
at
org.springframework.web.servlet.tags.form.OptionWriter.renderOption(OptionWriter.java:172)
at
org.springframework.web.servlet.tags.form.OptionWriter.doRenderFromCollection(OptionWriter.java:155)
Cheers
Aled
Michael Horwitz wrote:
Hmm. In that case you might want to take a look at Spring's form tags
to make life a little easier:
http://static.springframework.org/spring/docs/2.0.x/reference/spring-form.tld.html
<http://static.springframework.org/spring/docs/2.0.x/reference/spring-form.tld.html>
So your JSP would look something like:
<spring:form commandName="website" ...>
...
<spring:select path="contact.country" items="${countries}"
itemLabel="name" itemValue="id"/>
....
</spring:form>
A lot simpler and Spring will do all the hard work for you. As long as
your form backing object has a non-null contact attribute, it should
all work like magic. I think the problem in your code is the name you
attach to the select element - Spring expects specific names to get
its bindings sorted out.
Mike.
On 7/6/07, *Aled Rhys Jones* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
m4, wanted to finish off some functionality before updating to m5.
Cheers
Aled
------------------------------------------------------------------------
*From:* Michael Horwitz [mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>]
*Sent:* 06 July 2007 08:39
*To:* [email protected] <mailto:[email protected]>
*Subject:* Re: [appfuse-user] Drop down list population
Which version of AppFuse are you using Aled?
On 7/5/07, *Tsung* < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
wrote:
Aled - Rather than having setCountryManager method, pass the
CountryManager
referene in CountryEditor's constructor.
--
View this message in context:
http://www.nabble.com/Add-ManyToOne-relationship-between-user-and-a-new-pojo-tf3993393s2369.html#a11454095
<http://www.nabble.com/Add-ManyToOne-relationship-between-user-and-a-new-pojo-tf3993393s2369.html#a11454095>
Sent from the AppFuse - User mailing list archive at Nabble.com
<http://nabble.com/>.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.476 / Virus Database: 269.10.1/888 - Release Date: 06/07/2007 06:36
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]