You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Parvez Sayeed <pa...@hotelinfosys.com> on 2002/08/26 20:17:54 UTC
RE: Why Scriplet is not processed in 'onchange' ele
ment ?
It works.
Thank you.
Parvez.
-----Original Message-----
From: Martin Cooper [mailto:martin.cooper@tumbleweed.com]
Sent: Friday, August 23, 2002 6:19 PM
To: 'Struts Users Mailing List'
Subject: RE: Why Scriplet is not processed in <html:select> 'onchange'
ele ment ?
> -----Original Message-----
> From: Parvez Sayeed [mailto:parvez.sayeed@hotelinfosys.com]
> Sent: Friday, August 23, 2002 4:08 PM
> To: Struts Users Mailing List
> Subject: Why Scriplet is not processed in <html:select> 'onchange'
> element ?
>
>
> In addition to my last question:
>
> How come in the following statement scriptlet is processed:
> <logic:lessThan
> name = "maintainCRSCodeCategoryForm"
> property="pageNbr"
>
> value="<%=Integer.toString(currentForm.getPageCount()-1)%>">
>
> But it does not get processed in :
>
> <html:select
> property="categoryCodeValue"
> styleClass="formFields"
>
> onChange="javascript:valueChanged(<%=Integer.toString(currentF
orm.getPageCou
> nt())%>)">
There are two problems here:
1) The attribute name is "onchange", not "onChange".
2) It is not legal to mix string literals with scripting expressions in an
attribute value. Try this instead:
onchange='<%= "javascript:valueChanged("
+ Integer.toString(currentForm.getPageCount())
+ ")" %>'
--
Martin Cooper
>
> Am I missing something why these two tags behave differently?
> Or is this a bug?
>
> Thanks.
> -----Original Message-----
> From: Parvez Sayeed
> Sent: Friday, August 23, 2002 1:30 PM
> To: Struts Users Mailing List
> Subject: Can you have Scriptlet or <bean:write> within a Struts-tag
> 'eleme nt'
>
>
> Hi,
>
> I was trying to do the following:
>
> <logic:iterate id="someId"
> type="some.class"
> name="someName"
> indexId="someIndex" // Used below in the select
> property=someProp>
>
> <bean:write property="prop1">
> ...
> ...
> <html:select
> name="beanName"
> property="propOne"
> onchange="optionChanged(<%=someIndex%>);"> //
> Used here in a
> javascript function call
> .....
> .....
> </html:select>
> ....
> ....
> </logic:iterate>
>
> Apparently this does not work. Is it at all possible? if not,
> can this be
> accomplished some other way?
>
> Thanks.
>
> --
> 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>
>
>
--
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>