select tag: deselcting option

2008-07-30 Thread ms . programmer . 1
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

2008-07-30 Thread ms . programmer . 1
I tried to use the  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
<[EMAIL PROTECTED]>wrote:

> See if  tag fits your needs.
>
> 2008/7/30 ms. programmer. 1 <[EMAIL PROTECTED]>:
>  > 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: "Invalid field value" on select with multiple="true"

2008-08-27 Thread ms . programmer . 1
I am having this same problem. Have you had any luck fixing this?

On Tue, Aug 26, 2008 at 3:33 PM, Jimmy Shabadoo
<[EMAIL PROTECTED]>wrote:

> Hi Folks,
>
> I have a class, Item, that has a Set of ItemCertifications. I want to
> represent ItemCertifications as a select box with the attribute
> multiple="true".
>
> Following is the jsp fragment that renders the select box:
> name="itemCertifications"
>list="certificationList"
>listKey="id"
>listValue="name"
>multiple="true"
>size="3"
>value="%{model.itemCertifications.{certification.id}}"
>/>
>
> The jsp page displays a muti-select field, and the list of certifications
> is
> displayed with the correct ones pre-selected. So far so good...
>
> However when I submit the form, I get a validation error [Invalid field
> value for field "itemCertifications"] although I am doing no validation on
> the field.
>
> My hunch is that this is some kind of type conversion problem... but all
> lists' ids are Long values, which is one of the auto-converted data types
> according to this: http://struts.apache.org/2.x/docs/type-conversion.html.
>
> Further leading me to believe it's a type conversion issue is that the
> setter method I would expect struts to call ( public void
> setItemCertifications(Long [] ids){} ) is never called...
>
> I'm using struts 2.0.11...
>
> Any ideas?
>