RE: html:select multiple="true" question

2004-01-21 Thread Mathew, Manoj
I used the same property name for select and Options tag..it worked in a dynaaction 
form.

Thank-you,
Manoj Mathew
GIS 515-362-0539


-Original Message-
From: Morten [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 21, 2004 6:00 AM
To: [EMAIL PROTECTED]
Subject: html:select multiple="true" question


Hi.

I have a bean stored in page scope with id "active". It returns
a String[] on getIds() and getLabels(). I use the following to render
a multiple select box:


   


What's wrong with this approach? I wish to have all elements
selected. All elements show and have the proper value/label,
but they do not get selected.

Can anyone please tell me how the property attribute of the select
tag determines what options get set as selected? Thanks.

Br,

Morten




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



html:select multiple="true" question

2004-01-21 Thread Morten
Hi.

I have a bean stored in page scope with id "active". It returns
a String[] on getIds() and getLabels(). I use the following to render
a multiple select box:

  

What's wrong with this approach? I wish to have all elements
selected. All elements show and have the proper value/label,
but they do not get selected.
Can anyone please tell me how the property attribute of the select
tag determines what options get set as selected? Thanks.
Br,

Morten



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: html:select multiple="true" and ActionForm

2003-09-17 Thread Ian Joyce
Minor correction:

public String[] getSelectedProductValues() should be
public ArrayList getSelectedProductValues()


Ian Joyce
Internet Systems Programmer/Analyst
American Academy of Family Physicians
Research and Information Services
Interactive Media
11400 Tomahawk Creek Parkway
Leawood, KS  66211-2672
Phone:  800-274-2237 ext 4219
Fax:  913-906-6271
E-mail:  [EMAIL PROTECTED]
>>> [EMAIL PROTECTED] 09/18/03 01:06 AM >>>
I've looked in the archives and googled but haven't come up with a solution yet.

I have a html:select multiple="true" form element.  When the form is submitted what 
setter should be called in the ActionForm?

My form
8<---8<---

  

8<---8<---

my ActionForm ( not working )
8<---8<---
public final class ProductsForm extends ActionForm {
   private ArrayList selectedProductValues = null;

   public void setSelectedProductValues(ArrayList selectedProductValues) {
  this.selectedProductValues = selectedProductValues;
   }

   public String[] getSelectedProductValues() {
  return this.selectedProductValues;
   }
}
8<---8<---

Thanks for any help...

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



html:select multiple="true" and ActionForm

2003-09-17 Thread Ian Joyce
I've looked in the archives and googled but haven't come up with a solution yet.

I have a html:select multiple="true" form element.  When the form is submitted what 
setter should be called in the ActionForm?

My form
8<---8<---

  

8<---8<---

my ActionForm ( not working )
8<---8<---
public final class ProductsForm extends ActionForm {
   private ArrayList selectedProductValues = null;

   public void setSelectedProductValues(ArrayList selectedProductValues) {
  this.selectedProductValues = selectedProductValues;
   }

   public String[] getSelectedProductValues() {
  return this.selectedProductValues;
   }
}
8<---8<---

Thanks for any help...

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: HTML:select multiple=true

2002-03-26 Thread Ted Husted

It's difficult to tell what the exact problem is without seeing at least
the interface code for the bean you are trying to expose. The tags
access the beans, so the beans are an essential part of the equation.

http://www.tuxedo.org/~esr/faqs/smart-questions.html

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services


johnseitz wrote:
> 
> I have an object called AreaCode which contains a property called
> areaId.
> 
> I have an object called AreaDislayBean which contains a property
> called areas.  This property is an array property which returns
> AreaCode[] array.
> 
> My  tag looks like this:
> 
>   options tags are here
> 
> 
> Now maybe I'm stupid (which is very possible), but I though that
> struts tags could handle this property propagation.  But it
> consisteny returns an error.
> 
> So what I did is make the AreaDisplayBean contain a property called
> areaIds which is an array property of Long.  After making the change
> to the html:select tag to use the property name "areaIds", the
> select tag renders correctly.
> 
> It just seems odd that I would have to rip apart my AreaCode object
> to get to its areaId property. Am I using the tag correctly?  Can
> someone throw me a bone in the right direction?
> 
> Thanks
> 
> John
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




HTML:select multiple=true

2002-03-21 Thread johnseitz

I have an object called AreaCode which contains a property called 
areaId.  

I have an object called AreaDislayBean which contains a property 
called areas.  This property is an array property which returns 
AreaCode[] array.

My  tag looks like this:

  options tags are here


Now maybe I'm stupid (which is very possible), but I though that 
struts tags could handle this property propagation.  But it 
consisteny returns an error.

So what I did is make the AreaDisplayBean contain a property called 
areaIds which is an array property of Long.  After making the change 
to the html:select tag to use the property name "areaIds", the 
select tag renders correctly.

It just seems odd that I would have to rip apart my AreaCode object 
to get to its areaId property. Am I using the tag correctly?  Can 
someone throw me a bone in the right direction?

Thanks

John



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Problem with html:select multiple=true and enctype=multipart/from-data

2001-08-22 Thread Bar³omiej Paw³owski

Hi everyone
I have the following in a form in a jsp:
  
  
   
 
  

 In ActionFrom I have following methods:
public void setKeys(Object[] keys) {
this.keys = keys;
}
public Object[] getKeys() {
return this.keys;
}

and when I hit submit everything is OK.
i.e. keys.length = 0,1,2,3,4,5,6,

but when I add
method="post" enctype="multipart/form-data"
keys.length always equals 0 or 1
why?

could someone point me to the solution, please ?

Thanx
Bartek
Poland