You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Paul Blundell <pa...@yahoo.com> on 2003/03/26 16:20:55 UTC

Month dropdown field error

I am trying to create a month dropdown dropdown using the datetime 'dt' tag.

The following code results in an error:

<html:select property="startMonth">
  <html:option value="Month"/>
  <dt:months id="mon" locale="true">
    <html:option value="<jsp:getProperty name="mon"
property="monthOfYear"/>">
  </dt:months>
</html:select>

Any ideas?

Thanks
Paul



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Month dropdown field error

Posted by James Mitchell <jm...@apache.org>.
On Wed, 2003-03-26 at 10:20, Paul Blundell wrote:
> I am trying to create a month dropdown dropdown using the datetime 'dt' tag.
> 
> The following code results in an error:
> 
> <html:select property="startMonth">
>   <html:option value="Month"/>
>   <dt:months id="mon" locale="true">
>     <html:option value="<jsp:getProperty name="mon"
> property="monthOfYear"/>">
>   </dt:months>
> </html:select>
> 
> Any ideas?

Yes, you can't embed tags within tags.  Take a look at <html:options>
tag or if you only need a single value from a bean use:

 <bean:define id="month" name="mon" property="monthOfYear/>

 <html:select property="startMonth">
   <html:option value="Month"/>
   <dt:months id="mon" locale="true">
     <html:option value="<%=month%>">
   </dt:months>
 </html:select>

> 
> Thanks
> Paul
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
-- 
James Mitchell
Software Developer/Struts Evangelist
http://www.open-tools.org




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Month dropdown field error

Posted by Andrew Hill <an...@gridnode.com>.
Perhaps you would like to share the error message wit... oop hang on ... I
see your problem already:
You can't nest tags like that.
<snip>
 <html:option value="<jsp:getProperty name="mon"
</snip>
Ive forgotten the way around that one as I dont use JSP myself. No doubt
someone will post the proper approach shortly as its a common mistake to
make. (It was my first JSP mistake too!)

-----Original Message-----
From: Paul Blundell [mailto:paulblundell@yahoo.com]
Sent: Wednesday, 26 March 2003 23:21
To: struts-user@jakarta.apache.org
Subject: Month dropdown field error


I am trying to create a month dropdown dropdown using the datetime 'dt' tag.

The following code results in an error:

<html:select property="startMonth">
  <html:option value="Month"/>
  <dt:months id="mon" locale="true">
    <html:option value="<jsp:getProperty name="mon"
property="monthOfYear"/>">
  </dt:months>
</html:select>

Any ideas?

Thanks
Paul



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org