You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "ms.programmer.1" <ms...@gmail.com> on 2008/07/30 14:56:12 UTC
select tag: deselcting option
I am populating the options in select list B from the option selected in
select list A, when a button is clicked. When a new option is selected in
select list A, I want the previous option in select list B to be deselected.
The value for these select lists is being stored in the session. I have been
trying to write a javascript function that I would set the onchange
attribute to to do this but nothing I try is working. I dont really know
javascript either. I was wondering if there is a way that I can call a
method from my action class to achieve this. Is there a way to set the
onchange attribute to a url that will call a method in my action class? Or
is there another way I can get this to work.
Thanks!
Re: select tag: deselcting option
Posted by Dave Newton <ne...@yahoo.com>.
Without knowing anything about the JSP causing the error it will be more difficult to help.
Dave
--- On Wed, 7/30/08, ms.programmer.1 <ms...@gmail.com> wrote:
I tried to use the <s:doubleselect> tag but I get a FreeMarker
> template error.
>
> *FreeMarker template error!*
>
> Error on line 122, column 65 in
> template/simple/doubleselect.ftl
> Expecting a string, date or number here, Expression
> parameters.doubleNameValue is instead a
> freemarker.ext.beans.ArrayModel
> The problematic instruction:
> ----------
> ==> ${parameters.doubleNameValue} [on line 122, column
> 63 in
> template/simple/doubleselect.ftl]
> in include
> "/${parameters.templateDir}/simple/doubleselect.ftl"
> [on
> line 25, column 1 in template/css_xhtml/doubleselect.ftl]
> ----------
>
> Java backtrace for programmers:
> ----------
> freemarker.core.NonStringException: Error on line 122,
> column 65 in
> template/simple/doubleselect.ftl
> Expecting a string, date or number here, Expression
> parameters.doubleNameValue is instead a
> freemarker.ext.beans.ArrayModel
> at
> freemarker.core.Expression.getStringValue(Expression.java:126)
>
>
> at
> freemarker.core.Expression.getStringValue(Expression.java:93)
> at
> freemarker.core.DollarVariable.accept(DollarVariable.java:76)
> at freemarker.core.Environment.visit(Environment.java:196)
> at
> freemarker.core.MixedContent.accept(MixedContent.java:92)
> at freemarker.core.Environment.visit(Environment.java:196)
> at
> freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
> at freemarker.core.Environment.visit(Environment.java:196)
> at
> freemarker.core.MixedContent.accept(MixedContent.java:92)
> at freemarker.core.Environment.visit(Environment.java:196)
> at
> freemarker.core.Environment.include(Environment.java:1375)
> at freemarker.core.Include.accept(Include.java:155)
> at freemarker.core.Environment.visit(Environment.java:196)
> at
> freemarker.core.MixedContent.accept(MixedContent.java:92)
> at freemarker.core.Environment.visit(Environment.java:196)
> at
> freemarker.core.Environment.process(Environment.java:176)
> at freemarker.template.Template.process(Template.java:232)
> at
> org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:168)
> at
> org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:530)
> at
> org.apache.struts2.components.UIBean.end(UIBean.java:484)
> at
> org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:43)
>
>
>
> On Wed, Jul 30, 2008 at 9:23 AM, Gabriel Belingueres
> <be...@gmail.com>wrote:
>
> > See if <s:doubleselect> tag fits your needs.
> >
> > 2008/7/30 ms. programmer. 1
> <ms...@gmail.com>:
> > > I am populating the options in select list B
> from the option selected
> > in
> > > select list A, when a button is clicked. When a
> new option is selected in
> > > select list A, I want the previous option in
> select list B to be
> > deselected.
> > > The value for these select lists is being stored
> in the session. I have
> > been
> > > trying to write a javascript function that I
> would set the onchange
> > > attribute to to do this but nothing I try is
> working. I dont really know
> > > javascript either. I was wondering if there is a
> way that I can call a
> > > method from my action class to achieve this. Is
> there a way to set the
> > > onchange attribute to a url that will call a
> method in my action class?
> > Or
> > > is there another way I can get this to work.
> > >
> > > Thanks!
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> >
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: select tag: deselcting option
Posted by "ms.programmer.1" <ms...@gmail.com>.
I tried to use the <s:doubleselect> tag but I get a FreeMarker template
error.
*FreeMarker template error!*
Error on line 122, column 65 in template/simple/doubleselect.ftl
Expecting a string, date or number here, Expression
parameters.doubleNameValue is instead a
freemarker.ext.beans.ArrayModel
The problematic instruction:
----------
==> ${parameters.doubleNameValue} [on line 122, column 63 in
template/simple/doubleselect.ftl]
in include "/${parameters.templateDir}/simple/doubleselect.ftl" [on
line 25, column 1 in template/css_xhtml/doubleselect.ftl]
----------
Java backtrace for programmers:
----------
freemarker.core.NonStringException: Error on line 122, column 65 in
template/simple/doubleselect.ftl
Expecting a string, date or number here, Expression
parameters.doubleNameValue is instead a
freemarker.ext.beans.ArrayModel
at freemarker.core.Expression.getStringValue(Expression.java:126)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.include(Environment.java:1375)
at freemarker.core.Include.accept(Include.java:155)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.process(Environment.java:176)
at freemarker.template.Template.process(Template.java:232)
at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:168)
at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:530)
at org.apache.struts2.components.UIBean.end(UIBean.java:484)
at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:43)
On Wed, Jul 30, 2008 at 9:23 AM, Gabriel Belingueres
<be...@gmail.com>wrote:
> See if <s:doubleselect> tag fits your needs.
>
> 2008/7/30 ms. programmer. 1 <ms...@gmail.com>:
> > I am populating the options in select list B from the option selected
> in
> > select list A, when a button is clicked. When a new option is selected in
> > select list A, I want the previous option in select list B to be
> deselected.
> > The value for these select lists is being stored in the session. I have
> been
> > trying to write a javascript function that I would set the onchange
> > attribute to to do this but nothing I try is working. I dont really know
> > javascript either. I was wondering if there is a way that I can call a
> > method from my action class to achieve this. Is there a way to set the
> > onchange attribute to a url that will call a method in my action class?
> Or
> > is there another way I can get this to work.
> >
> > Thanks!
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: select tag: deselcting option
Posted by Gabriel Belingueres <be...@gmail.com>.
See if <s:doubleselect> tag fits your needs.
2008/7/30 ms. programmer. 1 <ms...@gmail.com>:
> I am populating the options in select list B from the option selected in
> select list A, when a button is clicked. When a new option is selected in
> select list A, I want the previous option in select list B to be deselected.
> The value for these select lists is being stored in the session. I have been
> trying to write a javascript function that I would set the onchange
> attribute to to do this but nothing I try is working. I dont really know
> javascript either. I was wondering if there is a way that I can call a
> method from my action class to achieve this. Is there a way to set the
> onchange attribute to a url that will call a method in my action class? Or
> is there another way I can get this to work.
>
> Thanks!
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org