You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Richards, Devin N (Devin)" <de...@lucent.com> on 2002/09/18 19:54:10 UTC
RE: AAAARGH! SOMEONE! How do I set the default selection when I'm
using html:options?
I have a list of countries in my JSP:
<html:select property="shippingCountry" onchange="setSameAsAbove(false);" styleClass="T1">
<html:option key="label.countrySelect" value="" />
<html:options collection="countries" property="countryCode" labelProperty="countryName" filter="false" />
</html:select>
And then in my ValidatorForm class's reset() method I have:
ArrayList countries = // list of countries from LDAP
String shippingCountry = // users country from LDAP
When the page displays the <html:options> list has all of our countries, with the specified country selected.
HTH
-Devin
-----Original Message-----
From: Michael Lee [mailto:mleejr@hotmail.com]
Sent: Wednesday, September 18, 2002 12:55 PM
To: Struts Users Mailing List
Subject: Re: AAAARGH! SOMEONE! How do I set the default selection when
I'm using html:options?
Thanks, but nada.
The ActionForm state is set yet its still not working. :(
Is the problem with the options?
<html:select property="state" size="1">
<html:options name="allUnitedStates" labelName="allUnitedStates"/>
</html:select>
----- Original Message -----
From: "Hoang, Hai" <Ha...@coair.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Wednesday, September 18, 2002 11:31 AM
Subject: RE: How do I set the default selection when I'm using html:options?
> You need to populate the value of the property of the dropdown before the
> jsp is render...the best way to do this is in the action class.
>
> For example, you have getter and setter for State in the form bean...now
you
> need to setState("TX") in the action class if you want to have Texas as a
> default state.
>
> -----Original Message-----
> From: wbchmura@Ensign-BickfordInd.com
> [mailto:wbchmura@Ensign-BickfordInd.com]
> Sent: Wednesday, September 18, 2002 10:28 AM
> To: struts-user@jakarta.apache.org
> Subject: RE: How do I set the default selection when I'm using
html:options?
>
>
> You can add in an <html:option> tag above the <html:options> tag that
> will be the default.
>
>
>
> -----Original Message-----
> From: mleejr [mailto:mleejr@hotmail.com]
> Sent: Wednesday, September 18, 2002 11:21 AM
> To: struts-user
> Subject: How do I set the default selection when I'm using html:options?
>
>
> 1) How do I set a default value in an html:select on an options list? I
> need the default state to be the one loaded from the struts form.
> It doesn't like this.
>
> <html:select property="state" size="1" value="<%= state in ActionForm
> %>">
> <html:options name="allUnitedStates" labelName="allUnitedStates"/>
> </html:select>
>
> thanks everyone,
> Mike
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
> _________________________________________________________________________
> Introducing the all new and improved continental.com. With a totally new
> personalized design, it's the best place to go. Before you go.
>
> Continental Airlines. Work Hard. Fly Right.
>
> http://www.continental.com
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: not really solved
Posted by Andrew Hill <an...@gridnode.com>.
Hmm. Thats wierd.
I cant imagine that it is a problem with the radio button onclick as it
appears to be submitting the form to the correct url. The only thing I can
think of (and its just a guess as you havent included your code in the
question you posted) is that the submit button sets a value that is being
submitted and that something expecting this value throws an exception when
it doesnt find it (as it would not be set by the javascript submission).
Are you perchance using a DispatchAction, and the submit button sets your
method parameter?
btw: Are you using IE with "show friendly error messages" enabled? If so
switch off this option as its a bit like Zaphod Beeblebrox's sunglasses when
it comes to errors in that it hides the actual error message making it
harder for you to track down the cause of problems...
-----Original Message-----
From: Cathy Osekizoglu [mailto:hinbsls@yahoo.ca]
Sent: Thursday, September 19, 2002 02:08
To: Struts Users Mailing List
Subject: not really solved
Hi:
I have
<html:form action="/payment.do">
<html:radio property="criteria" value="all"
onclick="document.myForm.submit();"/>
payment.do and myForm are correctly configed in struts-config.xml. When I
submit the form by clicking on radio button, the URL changed to
http://localhost:7001/rootContext/payment.do, which is expected, but the
page displayed "error 500-internal server error". The error log
is:"RequestProcessor---null". If I use a submit button to submit the form,
it works fine. Is there something wrong with radio button onclick? any
ideas? I am using struts1.1
Thank you for your help.
---------------------------------
Post your free ad now! Yahoo! Canada Personals
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
not really solved
Posted by Cathy Osekizoglu <hi...@yahoo.ca>.
Hi:
I have
<html:form action="/payment.do">
<html:radio property="criteria" value="all" onclick="document.myForm.submit();"/>
payment.do and myForm are correctly configed in struts-config.xml. When I submit the form by clicking on radio button, the URL changed to http://localhost:7001/rootContext/payment.do, which is expected, but the page displayed "error 500-internal server error". The error log is:"RequestProcessor---null". If I use a submit button to submit the form, it works fine. Is there something wrong with radio button onclick? any ideas? I am using struts1.1
Thank you for your help.
---------------------------------
Post your free ad now! Yahoo! Canada Personals