Using multibox to indicate checked value

2008-11-30 Thread Odelya Yom-Tov Glick
Hi guys

I have this ActionForm

public class InterestsForm extends ActionForm {
private String[] selectedItems = {}; 
private String[] items = {"business","htech""};
  private String[] userPreviousSelectedItems= {"business"};
public String[] getSelectedItems() { 
  return this.selectedItems; 
} 
public void setSelectedItems(String[] selectedItems) { 
  this.selectedItems = selectedItems; 
}

}

And this form:




" />



I would like to check the items that the user checked previously and I
stored them in userPreviousSelectedItems (I can also create a collection
instead).

How can I do it?

Thanks

Odelya



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



Map based Struts Action Form and multibox Issue

2008-02-21 Thread MoorthyHome.com

I am using map based Struts action form 

Something like below...

public FooForm extends ActionForm {

private final Map values = new HashMap();

public void setValue(String key, Object value) {
values.put(key, value);
}

public Object getValue(String key) {
return values.get(key);
}

}

In Jsp I have something like below

  
 
 


  

Map based Form works well for others except multibox or select with
multiple=true

In setValue, The Object value always String and not String array that is
what I expect for multibox or multiple select

Since this is String, the form is selected with just one selection the first
selection..

Please help

-- 
View this message in context: 
http://www.nabble.com/Map-based-Struts-Action-Form-and-multibox-Issue-tp15623494p15623494.html
Sent from the Struts - User mailing list archive at Nabble.com.


struts action form vs # of multibox fields determined at runtime

2007-11-28 Thread john feng
I have a jsp page that produces a matrix page based on database queries for
both column header records and row records. The column and row crossed
fields are displayed as multiboxes, i.e., each vertical column of those is a
multibox field named as "crossCheckBox0", "crossCheckBox1",
"crossCheckBox2", ...starting from left to right. The number of those
columns is determined at run time by database queries.

If the number of fields is known at design time, then they can be added in
to action form as String[] attibute, then one may take advantage of that
struts would determine how many of the vertical boxes(rows) are checked at
runtime.

But now the number of mutlibox fields are dynamic and not design time
determined, it is an unknown dimension array like crossCheckBox[#][#]...[#]
where # stands for the number of rows being same. How to represent it in
action form?

Currently I have used javascript to loop thru the table to find out the each
column's checked boxes and could not take advantage of struts multibox
feature. Since I don't know how to add them into action form, I changed them
into pure html .

May anyone have experienced this issue before and would like to shed some
light on it? I would appreciate a ton for the insight.


RE: RE: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form

2006-11-17 Thread Lance Semmens
RequestProcessor is doing it's job by resetting the form. What should then 
happen is that your checkboxes should be set after reset() is called which 
doesn't seem to be happening.

Somethings not right here, esp since when you comment out reset, it works. Can 
you post your code? pls. include the relevant parts of struts-config.xml, your 
action and your form.

-Original Message-
From: Garner Shawn [mailto:[EMAIL PROTECTED] 
Sent: 14 November 2006 17:36
To: user@struts.apache.org
Subject: RE: RE: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped 
form

I am not explicitly calling the reset anywhere.
I've also debugged it and can not find anything out of the ordinary.
>From I can tell it is the request processor that is resetting my form
prior to the page displaying that ends up with the checkboxes not
checked.

Any help?


Shawn

--
From: Lance Semmens <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' 
Date: Tue, 14 Nov 2006 09:51:00 +
Subject: RE: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form
The only thing I can think is maybe you're explicitly calling reset()
in your action (instead of letting struts do it automatically). If
not, I suggest putting a debug breakpoint on the setters for your
checkboxes and see what's going on.

-
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]



RE: RE: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form

2006-11-14 Thread Garner Shawn

I am not explicitly calling the reset anywhere.
I've also debugged it and can not find anything out of the ordinary.

From I can tell it is the request processor that is resetting my form

prior to the page displaying that ends up with the checkboxes not
checked.

Any help?


Shawn

--
From: Lance Semmens <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' 
Date: Tue, 14 Nov 2006 09:51:00 +
Subject: RE: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form
The only thing I can think is maybe you're explicitly calling reset()
in your action (instead of letting struts do it automatically). If
not, I suggest putting a debug breakpoint on the setters for your
checkboxes and see what's going on.

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



RE: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form

2006-11-14 Thread Lance Semmens
The only thing I can think is maybe you're explicitly calling reset() in your 
action (instead of letting struts do it automatically). If not, I suggest 
putting a debug breakpoint on the setters for your checkboxes and see what's 
going on.
 
-Original Message-
From: Garner Shawn [mailto:[EMAIL PROTECTED] 
Sent: 13 November 2006 20:19
To: user@struts.apache.org
Subject: RE: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form

1. Yes
2. Yes
3  In ActionForm.reset

If I comment out my reset method then it populates the checkboxes
based on the form values like I want however I then loose the ability
to only get the checked value put into my action form after the page
is submitted.



From: Lance Semmens <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' 
Date: Mon, 13 Nov 2006 17:08:00 +
Subject: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form
A couple of things to check
1. Is your get action using the same form as your post action?
2. Do the names of the checkboxes in the html match your form?
3. Where are you resetting the checkboxes? I'm hoping you're doing it
by overriding ActionForm.reset().

-
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]



RE: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form

2006-11-13 Thread Garner Shawn

1. Yes
2. Yes
3  In ActionForm.reset

If I comment out my reset method then it populates the checkboxes
based on the form values like I want however I then loose the ability
to only get the checked value put into my action form after the page
is submitted.



From: Lance Semmens <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' 
Date: Mon, 13 Nov 2006 17:08:00 +
Subject: RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form
A couple of things to check
1. Is your get action using the same form as your post action?
2. Do the names of the checkboxes in the html match your form?
3. Where are you resetting the checkboxes? I'm hoping you're doing it
by overriding ActionForm.reset().

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



RE: [HELP] struts 1.2.9 multibox/checkbox in session scoped form

2006-11-13 Thread Lance Semmens
A couple of things to check
1. Is your get action using the same form as your post action?
2. Do the names of the checkboxes in the html match your form?
3. Where are you resetting the checkboxes? I'm hoping you're doing it by 
overriding ActionForm.reset().

-Original Message-
From: Garner Shawn [mailto:[EMAIL PROTECTED] 
Sent: 13 November 2006 16:47
To: user@struts.apache.org
Subject: [HELP] struts 1.2.9 multibox/checkbox in session scoped form

I reset my checkboxes and a multibox in a form reset method but then
when I come back to the page the values arn't checked.
If I don't reset them then it won't register them as not checked anymore.

How do I fix this?

Shawn

-
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]



[HELP] struts 1.2.9 multibox/checkbox in session scoped form

2006-11-13 Thread Garner Shawn

I reset my checkboxes and a multibox in a form reset method but then
when I come back to the page the values arn't checked.
If I don't reset them then it won't register them as not checked anymore.

How do I fix this?

Shawn

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



Re: doubt with multibox

2006-10-25 Thread Laurie Harper

Yariel Ramos Moreno wrote:

hello...

I´m using html:multibox to generate a dynamic list of items... so far so
good, but I have a problem because at the same time I generate a dynamic
list too, but this list print always the same (example "working")... then,
what can I do if the second list always print the same and this is not
the way html:multibox work?...

example:

My items:

[] item 1 [] working
[] item 2 [] working
[] item 3 [] working
[] item 4 [] working
[] item n [] working


I'm not sure I understand the question, but it sounds like you're not 
iterating your second list. You're probably missing an index expression. 
Post your JSP code if you can't get it figured out.


L.


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



doubt with multibox

2006-10-24 Thread Yariel Ramos Moreno
hello...

I´m using html:multibox to generate a dynamic list of items... so far so
good, but I have a problem because at the same time I generate a dynamic
list too, but this list print always the same (example "working")... then,
what can I do if the second list always print the same and this is not
the way html:multibox work?...

example:

My items:

[] item 1 [] working
[] item 2 [] working
[] item 3 [] working
[] item 4 [] working
[] item n [] working

thanks!!!


__

XIII Convención Científica de Ingeniería y Arquitectura
28/noviembre al 1/diciembre de 2006
Cujae, Ciudad de la Habana, Cuba
http://www.cujae.edu.cu/eventos/convencion


Re: Check a multibox dynamically

2006-10-04 Thread Uday Karrothi

Hi thre,

I am trying to give you an example.  Multibox basically fills in using a
string array. i am sure you are aware of that.



   
   


in the code " toBeAddedList" is the string array in the form bean that has
the userID's of the selected users. So, when the check boxes are being
checked , if the userID()
is present in the string array then the checkbox is checked. else no. And
when you try to retrieve the array in the action form the string array
contains all the userID's selected.
in the action form you can set the array and the multibox is populated.
 toBeAddedList[i] = .getUserID();

you can even set the checkboxes in the Javascript
function checkAllToBeAddedList()
{
 for(var i=0; i wrote:



Hi,

I have a multibox tag that gets the labels and velues from the data base
and
I also have a bean that contains the data that the user choose. Now I want
to check the boxes each time the user wants to update it's preferences.

1. I display the check boxes with the data comming from the data base
2. I want to compare those values whit the values that the user has
3. If there is a value equals to the value in the current multiboxes,
check
them

Can anybody help me

Thanks a lot
--
View this message in context:
http://www.nabble.com/Check-a-multibox-dynamically-tf2379274.html#a6630704
Sent from the Struts - User mailing list archive at Nabble.com.


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




Check a multibox dynamically

2006-10-03 Thread grifoxx

Hi,

I have a multibox tag that gets the labels and velues from the data base and
I also have a bean that contains the data that the user choose. Now I want
to check the boxes each time the user wants to update it's preferences.

1. I display the check boxes with the data comming from the data base
2. I want to compare those values whit the values that the user has
3. If there is a value equals to the value in the current multiboxes, check
them

Can anybody help me

Thanks a lot
-- 
View this message in context: 
http://www.nabble.com/Check-a-multibox-dynamically-tf2379274.html#a6630704
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: multibox not works when all checkboxes are unselected!

2006-06-08 Thread Truong Xuan Tinh
I dont' have such a sequence like that, but you can get the same when
you read the source code of the RequestProcessor class.
starki78 wrote:
> Thanks for this great explanations
> I already solved this problem
> and now 'm quite close to understand it!
> It would be great to have a sequence diagramm
> to see this flow
> submit-reset-populate-validate
> because knowing this flow isn't quite clear
> to a normal struts-user.
>
> THANKS A LOT 
>
>
>   
>> starki78 wrote:
>> 
>>> Hi!
>>>
>>> I've a large problem with html:multibox.
>>> I've tree checkboxes. When I choose
>>> one or two or three it arrives correct
>>> at the next action!
>>> Only then all checkboxes are deselected
>>> it remembers the state of the checkboxes that was 
>>> selected before! The state of the form is session in struts-config.
>>> Can you help me with this problem??
>>> I really don't have an idea how to solve it!
>>>   
>>>   
>> As Adam J. mentioned, it sounds like you're using a session-scoped 
>> bean.  Try overriding (if you haven't already) the reset() method of 
>> your form bean and resetting the property:
>>
>> public void reset( ActionMapping mapping, HttpServletRequest request )
>> {
>> this.values = new String[0];
>> }
>>
>> If you're _not_ using a session bean (and are using a request-scoped one 
>> instead), you'll _still_ want to do the above.  Using this way in both 
>> cases, values from the previous request are discarded.  If the web 
>> browser doesn't send any checkbox values over (because none are 
>> checked), then this.values will be an empty array, which corresponds to 
>> the very state of the submitted form's checkboxes (ie: none are checked).
>>
>> The array of values in your formbean for an html:multibox are a list of 
>> values of checked checkboxes. So...
>>
>> 1. Form bean looks like this:
>> this.values = { "value1", "value3", "value5" };
>>
>> 2. Displayed form looks like this:
>> value1 1
>> value2 2
>> value3 3
>> value4 4
>> value5 5
>>
>> 3. HTML sent to browser looks like this:
>>  1
>>  2
>>  3
>>  4
>>  5
>>
>> 4. User unchecks ALL checkboxes, and submits the form.
>>
>> 5. Struts calls reset() on your form
>> - Your reset() method sets this.values = new String[0]
>>
>> 6. Struts populates your form, and _doesn't touch "values"_, because 
>> nothing is checked, so values remains an empty array.
>>
>> Sound good?
>>
>> - Scott
>>
>>
>> -
>> 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]
>
>
>   


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



Re: multibox not works when all checkboxes are unselected!

2006-06-08 Thread starki78
Thanks for this great explanations
I already solved this problem
and now 'm quite close to understand it!
It would be great to have a sequence diagramm
to see this flow
submit-reset-populate-validate
because knowing this flow isn't quite clear
to a normal struts-user.

THANKS A LOT


> starki78 wrote:
> > Hi!
> >
> > I've a large problem with html:multibox.
> > I've tree checkboxes. When I choose
> > one or two or three it arrives correct
> > at the next action!
> > Only then all checkboxes are deselected
> > it remembers the state of the checkboxes that was
> > selected before! The state of the form is session in struts-config.
> > Can you help me with this problem??
> > I really don't have an idea how to solve it!
> >
> As Adam J. mentioned, it sounds like you're using a session-scoped
> bean.  Try overriding (if you haven't already) the reset() method of
> your form bean and resetting the property:
>
> public void reset( ActionMapping mapping, HttpServletRequest request )
> {
> this.values = new String[0];
> }
>
> If you're _not_ using a session bean (and are using a request-scoped one
> instead), you'll _still_ want to do the above.  Using this way in both 
> cases, values from the previous request are discarded.  If the web
> browser doesn't send any checkbox values over (because none are
> checked), then this.values will be an empty array, which corresponds to
> the very state of the submitted form's checkboxes (ie: none are checked).
>
> The array of values in your formbean for an html:multibox are a list of
> values of checked checkboxes. So...
>
> 1. Form bean looks like this:
> this.values = { "value1", "value3", "value5" };
>
> 2. Displayed form looks like this:
> value1 1
> value2 2
> value3 3
> value4 4
> value5 5
>
> 3. HTML sent to browser looks like this:
>  1
>  2
>  3
>  4
>  5
>
> 4. User unchecks ALL checkboxes, and submits the form.
>
> 5. Struts calls reset() on your form
> - Your reset() method sets this.values = new String[0]
>
> 6. Struts populates your form, and _doesn't touch "values"_, because
> nothing is checked, so values remains an empty array.
>
> Sound good?
>
> - Scott
>
>
> -
> 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]



Re: multibox not works when all checkboxes are unselected!

2006-06-08 Thread Scott Van Wart

starki78 wrote:

Hi!

I've a large problem with html:multibox.
I've tree checkboxes. When I choose
one or two or three it arrives correct
at the next action!
Only then all checkboxes are deselected
it remembers the state of the checkboxes that was 
selected before! The state of the form is session in struts-config.

Can you help me with this problem??
I really don't have an idea how to solve it!
  
As Adam J. mentioned, it sounds like you're using a session-scoped 
bean.  Try overriding (if you haven't already) the reset() method of 
your form bean and resetting the property:


public void reset( ActionMapping mapping, HttpServletRequest request )
{
   this.values = new String[0];
}

If you're _not_ using a session bean (and are using a request-scoped one 
instead), you'll _still_ want to do the above.  Using this way in both 
cases, values from the previous request are discarded.  If the web 
browser doesn't send any checkbox values over (because none are 
checked), then this.values will be an empty array, which corresponds to 
the very state of the submitted form's checkboxes (ie: none are checked).


The array of values in your formbean for an html:multibox are a list of 
values of checked checkboxes. So...


1. Form bean looks like this:
this.values = { "value1", "value3", "value5" };

2. Displayed form looks like this:
value1 1
value2 2
value3 3
value4 4
value5 5

3. HTML sent to browser looks like this:
 1
 2
 3
 4
 5

4. User unchecks ALL checkboxes, and submits the form.

5. Struts calls reset() on your form
   - Your reset() method sets this.values = new String[0]

6. Struts populates your form, and _doesn't touch "values"_, because 
nothing is checked, so values remains an empty array.


Sound good?

- Scott


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



Re: multibox not works when all checkboxes are unselected!

2006-06-08 Thread Truong Xuan Tinh
   That's what you have to do, as Adam said, the browser won't send the
value of unselected checkboxes. The sequence for create your form bean
are : Create, Reset, Populate, and Validate. You should override the
Reset method of the ActionForm to make sure that your form bean accept
new value from the browser.
Hope this may help. ;)
starki78 wrote:
> Hi Adam I just tried:
> public void reset(ActionMapping mapping, HttpServletRequest request) {
>   
> multiboxvalues = new String[3];
> multiboxvalues[0] = "";
> multiboxvalues[1] = "";
> multiboxvalues[2] = "";
> 
>   }
>
> And now the problem seems to be solved but to be honest I
> don't have the knowledge to understand it!
>
> Thanks for you advice!
>
>
>
>
>   
>> Browsers are only required to submit values for checkboxes when they are
>> selected. So when a box is not checked, no value is sent, so the state
>> on the server is not changed. When using session scoped objects to store
>> the value of checkboxes your processing needs to be aware of the fact
>> that values for "checkbox=off" are not sent.
>>
>> -Adam 
>>
>> -Original Message-
>> From: starki78 [mailto:[EMAIL PROTECTED] 
>> Sent: Thursday, June 08, 2006 11:40 AM
>> To: user
>> Subject: multibox not works when all checkboxes are unselected!
>>
>> Hi!
>>
>> I've a large problem with html:multibox.
>> I've tree checkboxes. When I choose
>> one or two or three it arrives correct
>> at the next action!
>> Only then all checkboxes are deselected
>> it remembers the state of the checkboxes that was selected before! The
>> state of the form is session in struts-config.
>> Can you help me with this problem??
>> I really don't have an idea how to solve it!
>>
>> Thanks a lot!
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>> -
>> The information contained in this message may be privileged,
>> confidential, and protected from disclosure. If the reader of this
>> message is not the intended recipient, or any employee or agent
>> responsible for delivering this message to the intended recipient,
>> you are hereby notified that any dissemination, distribution, or
>> copying of this communication is strictly prohibited. If you have
>> received this communication in error, please notify us immediately
>> by replying to the message and deleting it from your computer.
>>
>> Thank you. Paychex, Inc.
>>
>>
>> -
>> 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]
>
>
>   


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



RE: multibox not works when all checkboxes are unselected!

2006-06-08 Thread starki78
Hi Adam I just tried:
public void reset(ActionMapping mapping, HttpServletRequest request) {

multiboxvalues = new String[3];
multiboxvalues[0] = "";
multiboxvalues[1] = "";
multiboxvalues[2] = "";

  }

And now the problem seems to be solved but to be honest I
don't have the knowledge to understand it!

Thanks for you advice!




> Browsers are only required to submit values for checkboxes when they are
> selected. So when a box is not checked, no value is sent, so the state
> on the server is not changed. When using session scoped objects to store
> the value of checkboxes your processing needs to be aware of the fact
> that values for "checkbox=off" are not sent.
>
> -Adam
>
> -Original Message-
> From: starki78 [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 08, 2006 11:40 AM
> To: user
> Subject: multibox not works when all checkboxes are unselected!
>
> Hi!
>
> I've a large problem with html:multibox.
> I've tree checkboxes. When I choose
> one or two or three it arrives correct
> at the next action!
> Only then all checkboxes are deselected
> it remembers the state of the checkboxes that was selected before! The
> state of the form is session in struts-config.
> Can you help me with this problem??
> I really don't have an idea how to solve it!
>
> Thanks a lot!
>
>
>
>
>
>
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> The information contained in this message may be privileged,
> confidential, and protected from disclosure. If the reader of this
> message is not the intended recipient, or any employee or agent
> responsible for delivering this message to the intended recipient,
> you are hereby notified that any dissemination, distribution, or
> copying of this communication is strictly prohibited. If you have
> received this communication in error, please notify us immediately
> by replying to the message and deleting it from your computer.
>
> Thank you. Paychex, Inc.
>
>
> -
> 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]



RE: multibox not works when all checkboxes are unselected!

2006-06-08 Thread Samere, Adam J
Browsers are only required to submit values for checkboxes when they are
selected. So when a box is not checked, no value is sent, so the state
on the server is not changed. When using session scoped objects to store
the value of checkboxes your processing needs to be aware of the fact
that values for "checkbox=off" are not sent.

-Adam 

-Original Message-
From: starki78 [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 11:40 AM
To: user
Subject: multibox not works when all checkboxes are unselected!

Hi!

I've a large problem with html:multibox.
I've tree checkboxes. When I choose
one or two or three it arrives correct
at the next action!
Only then all checkboxes are deselected
it remembers the state of the checkboxes that was selected before! The
state of the form is session in struts-config.
Can you help me with this problem??
I really don't have an idea how to solve it!

Thanks a lot!










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


-
The information contained in this message may be privileged,
confidential, and protected from disclosure. If the reader of this
message is not the intended recipient, or any employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.

Thank you. Paychex, Inc.


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



multibox not works when all checkboxes are unselected!

2006-06-08 Thread starki78
Hi!

I've a large problem with html:multibox.
I've tree checkboxes. When I choose
one or two or three it arrives correct
at the next action!
Only then all checkboxes are deselected
it remembers the state of the checkboxes that was
selected before! The state of the form is session in struts-config.
Can you help me with this problem??
I really don't have an idea how to solve it!

Thanks a lot!










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



Re: How do I insert a value from an id-iterate-bean into the value-tag of multibox?

2006-05-06 Thread Andreas Hartmann
Hello Rick,

Rick Reumann wrote:
> Andreas Hartmann wrote:
>> Hello Tarun,
>> 
>> Tarun Reddy wrote:
>>> Hi,
>>> You can do this way,
>>> 
>>> 
>>>   
>>> 
>>> 
>>>
>>> This should work.
>> 
>> This produces an Unterminated <html:multibox tag.
> 
> You sure you aren't missing the  ? Double check your typing.

My fault :-(. I didn't recognize the closing ">" after the property-value.
Now, it's working fine. Thank you to both, Tarun and Rick, for your great
help!

Is the component  above used as nested body
content of the html:multibox tag?

>> Btw: the property deaktserver resolves to a
>> get/setDeaktserver() which gets or sets an ArrayList .
> 
> I'm fairly certain your backing form bean property needs to be an array 
> (String[] typically) and not a List for a multibox. (I might be wrong, 
> though, but try changing it to String[] just to see.)

The get-/setDeaktserver backing form is used in the iterate-tag. The
backing form for the multibox is inaktmachines, which is an Array .


Kind regards,
Andreas Hartmann


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



Re: How do I insert a value from an id-iterate-bean into the value-tag of multibox?

2006-05-06 Thread Rick Reumann

Andreas Hartmann wrote:

Hello Tarun,

Tarun Reddy wrote:

Hi,
You can do this way,


  



This should work.


This produces an Unterminated <html:multibox tag.


You sure you aren't missing the  ? Double check your typing.



Btw: the property deaktserver resolves to a
get/setDeaktserver() which gets or sets an ArrayList .


I'm fairly certain your backing form bean property needs to be an array 
(String[] typically) and not a List for a multibox. (I might be wrong, 
though, but try changing it to String[] just to see.)


--
Rick
http://www.learntechnology.net

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



Re: How do I insert a value from an id-iterate-bean into the value-tag of multibox?

2006-05-05 Thread Andreas Hartmann

Hello Tarun,

Tarun Reddy wrote:

Hi,
You can do this way,


  



This should work.


This produces an Unterminated  wrote:


Hello!

I've got in a jsp the following code:





-> This does not work.


srv contains a string which I want to have as value of html:multibox. How
should it be written?


I would be glad to get a hint!
Kind regards,
Andreas Hartmann





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



Re: How do I insert a value from an id-iterate-bean into the value-tag of multibox?

2006-05-05 Thread Tarun Reddy

Hi,
You can do this way,

   
 
   


This should work.

On 5/5/06, Andreas Hartmann <[EMAIL PROTECTED]> wrote:


Hello!

I've got in a jsp the following code:





-> This does not work.


srv contains a string which I want to have as value of html:multibox. How
should it be written?


I would be glad to get a hint!
Kind regards,
Andreas Hartmann

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




How do I insert a value from an id-iterate-bean into the value-tag of multibox?

2006-05-05 Thread Andreas Hartmann
Hello!

I've got in a jsp the following code:





-> This does not work.


srv contains a string which I want to have as value of html:multibox. How
should it be written?


I would be glad to get a hint!
Kind regards,
Andreas Hartmann

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



RE: Ignorant multibox question.

2005-11-16 Thread bsimonin
Actually I got it to work elegantly with the following code:





 

 





But thanks for the link anywaysI will use it in the future.

Have you stumbled on this link:  http://husted.com/struts/tips/007.html

I think it's almost verbatim out of the Struts in Action Book

hth,

On 11/11/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Lets say I have the following multibox:
>
> 
> 
> 
>
> 
>  
>
> 
> 
> 
>
>
> I have a List of POJOs with a name and a boolean value for each POJO.  I want 
> to change the boolean value to true if a user check marks a specific item in 
> the List.
>
> If I wasn't in struts I could easily do this if I were using a Servlet. But 
> how and where do I read through each POJO in the List changing the POJO 
> instance variable to true if someone check marks it?


--
Keith Sader
[EMAIL PROTECTED]
http://www.saderfamily.org/roller/page/ksader
http://www.jroller.com/page/certifieddanger

-
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]



Re: Ignorant multibox question.

2005-11-11 Thread Keith Sader
Have you stumbled on this link:  http://husted.com/struts/tips/007.html

I think it's almost verbatim out of the Struts in Action Book

hth,

On 11/11/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Lets say I have the following multibox:
>
> 
> 
> 
>
> 
>  
>
> 
> 
> 
>
>
> I have a List of POJOs with a name and a boolean value for each POJO.  I want 
> to change the boolean value to true if a user check marks a specific item in 
> the List.
>
> If I wasn't in struts I could easily do this if I were using a Servlet. But 
> how and where do I read through each POJO in the List changing the POJO 
> instance variable to true if someone check marks it?


--
Keith Sader
[EMAIL PROTECTED]
http://www.saderfamily.org/roller/page/ksader
http://www.jroller.com/page/certifieddanger

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



Ignorant multibox question.

2005-11-11 Thread bsimonin

Lets say I have the following multibox:





 
 






I have a List of POJOs with a name and a boolean value for each POJO.  I want 
to change the boolean value to true if a user check marks a specific item in 
the List.  

If I wasn't in struts I could easily do this if I were using a Servlet. But how 
and where do I read through each POJO in the List changing the POJO instance 
variable to true if someone check marks it?  

 

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



Re: [OT] scrollbar vs multibox

2005-11-10 Thread Eric Plante
Thanks, it worked.

Sorry of the out of topic post.

> Eric Plante wrote:
> > hi,
> >
> > I have a div on autoscroll that contains multibox. Here's the code
> >
> > 
> >   
> >    
> >   
> >  
> >   
> >  
> >  
> >  
> >   
> > 
> >
> > It works fine when the vertical scroll bar is needed but instead of
> > applying the  horizontal, the text change line which is annoying.
> >
> > Any idea how the problem could be solved?
> >
> > Thanks
>
> This is nothing to do with Struts, it's just how the HTML render model
> works. I'm sure there are other solutions, but the two I'd look at to
> start would be setting nowrap or minwidth on the div in its CSS rules.
>
> L.
>
>
> -
> 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]



Re: [OT] scrollbar vs multibox

2005-11-10 Thread Laurie Harper

Eric Plante wrote:

hi,

I have a div on autoscroll that contains multibox. Here's the code


  
   
  

 
  
 

 
 
  


It works fine when the vertical scroll bar is needed but instead of 
applying the  horizontal, the text change line which is annoying.


Any idea how the problem could be solved?

Thanks


This is nothing to do with Struts, it's just how the HTML render model 
works. I'm sure there are other solutions, but the two I'd look at to 
start would be setting nowrap or minwidth on the div in its CSS rules.


L.


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



scrollbar vs multibox

2005-11-10 Thread Eric Plante

hi,

I have a div on autoscroll that contains multibox. Here's the code


  
   
  

 
  
 

 
 
  


It works fine when the vertical scroll bar is needed but instead of applying 
the  horizontal, the text change line which is annoying.


Any idea how the problem could be solved?

Thanks 



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



Re: multibox error

2005-10-30 Thread Deepa Khetan
is your form mapping correct in struts-config???


 On 10/29/05, Chris Pat <[EMAIL PROTECTED]> wrote:
>
> Hello
> I am using TC5.5.9,JSTL1.1,Struts1.2 With this code:
> 
> 
> 
>  value="Value1"/>
> 
> 
> 
> 
> 
> 
> 
> 
> I have made sure my actionForm has the s/getter for
> checkbox1, checkbox2 & strArray. Made sure the reset
> is setting the booleans to false. The page comes up
> without the html:multibox tag, so everything else is
> correct. Except for the error below. It seems like a
> tag library issue. Any and all insight welcomed.
> tia.
>
>
> I am getting
> javax.servlet.ServletException: Cannot find bean under
> name org.apache.struts.taglib.html.BEAN
>
> org.apache.jasper.runtime.PageContextImpl.doHandlePageException(
> PageContextImpl.java:848)
>
> org.apache.jasper.runtime.PageContextImpl.handlePageException(
> PageContextImpl.java:781)
>
> org.apache.jsp.jsp2_jsp._jspService(org.apache.jsp.jsp2_jsp:107)
>
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
>
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java
> :322)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
>
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
>
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> root cause javax.servlet.jsp.JspException: Cannot find
> bean under name org.apache.struts.taglib.html.BEAN
>
> org.apache.struts.taglib.html.MultiboxTag.doEndTag(MultiboxTag.java:195)
>
> org.apache.jsp.jsp2_jsp._jspx_meth_html_multibox_0(
> org.apache.jsp.jsp2_jsp:125)
> org.apache.jsp.jsp2_jsp._jspService(org.apache.jsp.jsp2_jsp:88)
>
>
>
> __
> Start your day with Yahoo! - Make it your home page!
> http://www.yahoo.com/r/hs
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: multibox error

2005-10-30 Thread Laurie Harper

Is that table inside a html:form?

Chris Pat wrote:
Hello 
I am using TC5.5.9,JSTL1.1,Struts1.2 With this code:


  
 

 
  
  
 
 
 
  

I have made sure my actionForm has the s/getter for
checkbox1, checkbox2 & strArray.  Made sure the reset
is setting the booleans to false. The page comes up
without the html:multibox tag, so everything else is
correct.  Except for the error below.  It seems like a
tag library issue.  Any and all insight welcomed. 
tia.



I am getting 
javax.servlet.ServletException: Cannot find bean under

name org.apache.struts.taglib.html.BEAN

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)

org.apache.jsp.jsp2_jsp._jspService(org.apache.jsp.jsp2_jsp:107)

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause javax.servlet.jsp.JspException: Cannot find
bean under name org.apache.struts.taglib.html.BEAN

org.apache.struts.taglib.html.MultiboxTag.doEndTag(MultiboxTag.java:195)

org.apache.jsp.jsp2_jsp._jspx_meth_html_multibox_0(org.apache.jsp.jsp2_jsp:125)
 org.apache.jsp.jsp2_jsp._jspService(org.apache.jsp.jsp2_jsp:88)



__ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs



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



multibox error

2005-10-29 Thread Chris Pat
Hello 
I am using TC5.5.9,JSTL1.1,Struts1.2 With this code:

  
 

 
  
  
 
 
 
  

I have made sure my actionForm has the s/getter for
checkbox1, checkbox2 & strArray.  Made sure the reset
is setting the booleans to false. The page comes up
without the html:multibox tag, so everything else is
correct.  Except for the error below.  It seems like a
tag library issue.  Any and all insight welcomed. 
tia.


I am getting 
javax.servlet.ServletException: Cannot find bean under
name org.apache.struts.taglib.html.BEAN

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)

org.apache.jsp.jsp2_jsp._jspService(org.apache.jsp.jsp2_jsp:107)

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause javax.servlet.jsp.JspException: Cannot find
bean under name org.apache.struts.taglib.html.BEAN

org.apache.struts.taglib.html.MultiboxTag.doEndTag(MultiboxTag.java:195)

org.apache.jsp.jsp2_jsp._jspx_meth_html_multibox_0(org.apache.jsp.jsp2_jsp:125)
 org.apache.jsp.jsp2_jsp._jspService(org.apache.jsp.jsp2_jsp:88)



__ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

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



RE: Multibox problem

2005-07-06 Thread Shyam . Tummala
Hi-

Thanks for the response.

The map is in helper class and i dont want my helper class to know 
anything about struts or actionForm.

Thanks,
Shyam




"Apte, Dhanashree (Noblestar)" <[EMAIL PROTECTED]>
07/06/2005 11:45 AM
Please respond to "Struts Users Mailing List"
 
To: "'Struts Users Mailing List'" 
    cc: 
Subject:RE: Multibox problem



Code where i put the values back:
map.put("districtIds", stringArr);
where stringArr is an array of what the user selected.


-> This is not the same as calling setDistrictIds. You need to call
setDistrictIds(stringArr) explicitly.



RE: Multibox problem

2005-07-06 Thread Apte, Dhanashree (Noblestar)


Code where i put the values back:
map.put("districtIds", stringArr);
where stringArr is an array of what the user selected.


-> This is not the same as calling setDistrictIds. You need to call
setDistrictIds(stringArr) explicitly.


Multibox problem

2005-07-06 Thread Shyam . Tummala
Hi-

I am having a problem with repopulating multiboxes.

Scenario:

My application is a wizard based one. User clicks on a couple of 
checkboxes(multibox) and does a submit and after a couple of screens he 
wants to come back to the checkboxes screen and the way i do is, i save 
the values he clicked and then when he wants to come back i store those 
values in a list and then to the request with the same name as that of 
multibox, but the multiboxes are not selected and there is no tag in 
multibox using which i can say that.

For Eg:

My JSP page:

10Kansas City
11Dallas
12San Francisco

My form Bean:

private String [] districtIds = null;

public void setDistrictIds(String [] districtIds) {
this.districtIds = districtIds;
}

public String [] getDistrictIds() {
return this.districtIds;
}


Code where i put the values back:
map.put("districtIds", stringArr);
where stringArr is an array of what the user selected.

Thanks,
Shyam.

Re: Multibox

2005-03-19 Thread Vamsee Kanakala
Ben Taylor wrote:
Cheers, I've manged to get the ticks appearing now...  However
although they load fine on the first load they do not move after that.
i.e. I can change which ones are selected and it'll go off and update
the db but when I load the page again the origonal ticks are still
shown.
 

One reason could be that you defined the accompanying form with 
scope="session". If so, are you sure you need this? Then again, it could 
be that a method is pre-populating the checkboxes by retrieving the 
relevant values from the database that you just inserted. Can you post 
more code?

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


Re: Multibox

2005-03-19 Thread Ben Taylor
Cheers, I've manged to get the ticks appearing now...  However
although they load fine on the first load they do not move after that.
 i.e. I can change which ones are selected and it'll go off and update
the db but when I load the page again the origonal ticks are still
shown.

I've tried calling setting the String[] to null as well as each value
to "false" but nothing seems to work :o(



On Sat, 19 Mar 2005 18:51:30 -0500, Robert Taylor
<[EMAIL PROTECTED]> wrote:
> The multibox is "bound" to the selectedModule property of your form.
> Prior to displaying the page, populate selectedModule property of the
> form with its corresponding row.id values. When  is
> invoked on the page, it will "recongize" the relationship and render the
> checkboxes as checked.
> 
> /robert
> 
> Ben Taylor wrote:
> > Hi,
> >
> > Can anyone let me know how to automatically check checkboxes?
> >
> > Below is my current code:
> > 
> > 
> > 
> >
> > This is one of the many ways I've tried to get it to work:
> > 
> > {some Boolean equation}
> > 
> >
> >
> > Cheers for you 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]
> 
>

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



Re: Multibox

2005-03-19 Thread Robert Taylor
The multibox is "bound" to the selectedModule property of your form.
Prior to displaying the page, populate selectedModule property of the 
form with its corresponding row.id values. When  is 
invoked on the page, it will "recongize" the relationship and render the 
checkboxes as checked.

/robert
Ben Taylor wrote:
Hi,
Can anyone let me know how to automatically check checkboxes?
Below is my current code:



This is one of the many ways I've tried to get it to work:

{some Boolean equation}

Cheers for you 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]


Re: Multibox

2005-03-19 Thread Wendy Smoak
From: "Ben Taylor" <[EMAIL PROTECTED]>
Can anyone let me know how to automatically check checkboxes?
Set the underlying form property and the framework will automatically render 
"checked" checkboxes.

I have:

  
   


The form property "accounts" is a String[] containing account numbers.  So 
this displays all of the accounts in accountMap, and 'checks' the boxes next 
to the ones that match the values in the "accounts" form property.

--
Wendy Smoak 


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


Multibox

2005-03-19 Thread Ben Taylor
Hi,

Can anyone let me know how to automatically check checkboxes?

Below is my current code:




This is one of the many ways I've tried to get it to work:

{some Boolean equation}



Cheers for you help!

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



Re: map-backed forms with multibox/multiselect lists?

2005-03-08 Thread Radu Badita
That's great! Thanks for sharing.
Next time I'll know how to do it. Luckily you proved to be more 
determined and finally solved it. Congratulations!

Nidel, Mike wrote:
The good news is that this DOES work.
I simply declared my methods to be
public void setFoo(String key, String[] foos)
{
...
}
public String[] getFoo(String key)
{
...
}
and everything works fine. It took a detour through the Struts
source (and ultimately from there through the beanutils source)
to figure this out, but the problem was essentially that when
doing the bean introspection, the beanutils first finds the getFoo()
method and stores its return type. It then looks for a setFoo()
method with the same argument type as the return type of getFoo().
If you try to return foo as an Object, it just won't work -- your
setter won't be found and the method will never be called.
thanks for the input,
Mike
 

-Original Message-
From: Radu Badita [mailto:[EMAIL PROTECTED]
Sent: Monday, March 07, 2005 11:10 AM
To: Struts Users Mailing List
Subject: RE: map-backed forms with multibox/multiselect lists?

I had the same problem some time ago (the solution vaguely 
suggested by 
Jack wouldn't had been an option since the properties were 
dynamic so I 
needed the key to distinguish between them). I asked on this 
list for help 
at that time, but didn't got an answer, so I guess nobody 
succeeded in 
doing something like this. Therefore I had to find some other 
solution to 
my problem...
I'm guessing this might be some sort of a problem with 
commons-binutils 
(although public void setFoos(String key, String[] foos) 
isn't a valid 
javabeans setter so maybe it's just a bit out of it's scope).

At 16:44 07.03.2005, you wrote:
   

This works fine for list-backed form items (which we also use)
but in this case I need something like
public void setFoos(String key, String[] foos)
is this possible?
There are several workarounds I can think of, but this appears
to be the cleanest solution if I can make it work.
Mike
 

-Original Message-
From: Dakota Jack [mailto:[EMAIL PROTECTED]
Sent: Monday, March 07, 2005 9:42 AM
To: Struts Users Mailing List
Subject: Re: map-backed forms with multibox/multiselect lists?
public void setFoos(String [] foos)
On Fri, 4 Mar 2005 18:55:53 + (UTC), Mike Nidel
<[EMAIL PROTECTED]> wrote:
   

I'm trying to build a form element that combines the
 

features of a map-backed
   

property with a multibox (and the same for a
 

multiple-selection list). I've made
   

multiboxes work fine without the map-backed element, but I
 

can't seem to get
   

this to work.
I've tried various method signatures in my form bean, but
 

to no avail. For
   

example, for a field called "foo" I have tried the following:
public void setFoo(String key, Object val)
{
...
}
or
public void setFoo(String key, String[] val)
{
...
}
I'm using a set of checkboxes on the JSP which should
 

result in a list of the
   

values of whichever boxes are selected. I can think of a
 

number of javascript
   

workarounds, as well as workarounds in my Action that go
 

directly to the request
   

parameters... but all of those are kludges and it seems
 

like there should be a
   

way to have multiple checkboxes that all reference a
 

map-backed form property.
   

Any thoughts?
thanks a bunch,
Mike Nidel
 

-
   

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

--
"You can lead a horse to water but you cannot make it float
on its back."
~Dakota Jack~
   

-
   

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]
 

-
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]
 


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


RE: map-backed forms with multibox/multiselect lists?

2005-03-08 Thread Nidel, Mike
The good news is that this DOES work.

I simply declared my methods to be

public void setFoo(String key, String[] foos)
{
...
}

public String[] getFoo(String key)
{
...
}

and everything works fine. It took a detour through the Struts
source (and ultimately from there through the beanutils source)
to figure this out, but the problem was essentially that when
doing the bean introspection, the beanutils first finds the getFoo()
method and stores its return type. It then looks for a setFoo()
method with the same argument type as the return type of getFoo().
If you try to return foo as an Object, it just won't work -- your
setter won't be found and the method will never be called.

thanks for the input,

Mike


> -Original Message-
> From: Radu Badita [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 07, 2005 11:10 AM
> To: Struts Users Mailing List
> Subject: RE: map-backed forms with multibox/multiselect lists?
> 
> 
> 
> I had the same problem some time ago (the solution vaguely 
> suggested by 
> Jack wouldn't had been an option since the properties were 
> dynamic so I 
> needed the key to distinguish between them). I asked on this 
> list for help 
> at that time, but didn't got an answer, so I guess nobody 
> succeeded in 
> doing something like this. Therefore I had to find some other 
> solution to 
> my problem...
> I'm guessing this might be some sort of a problem with 
> commons-binutils 
> (although public void setFoos(String key, String[] foos) 
> isn't a valid 
> javabeans setter so maybe it's just a bit out of it's scope).
> 
> At 16:44 07.03.2005, you wrote:
> >This works fine for list-backed form items (which we also use)
> >but in this case I need something like
> >
> >public void setFoos(String key, String[] foos)
> >
> >is this possible?
> >
> >
> >There are several workarounds I can think of, but this appears
> >to be the cleanest solution if I can make it work.
> >
> >Mike
> >
> > > -Original Message-
> > > From: Dakota Jack [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, March 07, 2005 9:42 AM
> > > To: Struts Users Mailing List
> > > Subject: Re: map-backed forms with multibox/multiselect lists?
> > >
> > >
> > > public void setFoos(String [] foos)
> > >
> > >
> > > On Fri, 4 Mar 2005 18:55:53 + (UTC), Mike Nidel
> > > <[EMAIL PROTECTED]> wrote:
> > > > I'm trying to build a form element that combines the
> > > features of a map-backed
> > > > property with a multibox (and the same for a
> > > multiple-selection list). I've made
> > > > multiboxes work fine without the map-backed element, but I
> > > can't seem to get
> > > > this to work.
> > > >
> > > > I've tried various method signatures in my form bean, but
> > > to no avail. For
> > > > example, for a field called "foo" I have tried the following:
> > > >
> > > > public void setFoo(String key, Object val)
> > > > {
> > > > ...
> > > > }
> > > >
> > > > or
> > > >
> > > > public void setFoo(String key, String[] val)
> > > > {
> > > > ...
> > > > }
> > > >
> > > > I'm using a set of checkboxes on the JSP which should
> > > result in a list of the
> > > > values of whichever boxes are selected. I can think of a
> > > number of javascript
> > > > workarounds, as well as workarounds in my Action that go
> > > directly to the request
> > > > parameters... but all of those are kludges and it seems
> > > like there should be a
> > > > way to have multiple checkboxes that all reference a
> > > map-backed form property.
> > > >
> > > > Any thoughts?
> > > >
> > > > thanks a bunch,
> > > >
> > > > Mike Nidel
> > > >
> > > >
> > > 
> -
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> > > --
> > > "You can lead a horse to water but you cannot make it float
> > > on its back."
> > > ~Dakota Jack~
> > >
> > > 
> -
> > > 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]
> 
> 
> 
> -
> 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]



RE: map-backed forms with multibox/multiselect lists?

2005-03-07 Thread Radu Badita
I had the same problem some time ago (the solution vaguely suggested by 
Jack wouldn't had been an option since the properties were dynamic so I 
needed the key to distinguish between them). I asked on this list for help 
at that time, but didn't got an answer, so I guess nobody succeeded in 
doing something like this. Therefore I had to find some other solution to 
my problem...
I'm guessing this might be some sort of a problem with commons-binutils 
(although public void setFoos(String key, String[] foos) isn't a valid 
javabeans setter so maybe it's just a bit out of it's scope).

At 16:44 07.03.2005, you wrote:
This works fine for list-backed form items (which we also use)
but in this case I need something like
public void setFoos(String key, String[] foos)
is this possible?
There are several workarounds I can think of, but this appears
to be the cleanest solution if I can make it work.
Mike
> -Original Message-
> From: Dakota Jack [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 07, 2005 9:42 AM
> To: Struts Users Mailing List
> Subject: Re: map-backed forms with multibox/multiselect lists?
>
>
> public void setFoos(String [] foos)
>
>
> On Fri, 4 Mar 2005 18:55:53 + (UTC), Mike Nidel
> <[EMAIL PROTECTED]> wrote:
> > I'm trying to build a form element that combines the
> features of a map-backed
> > property with a multibox (and the same for a
> multiple-selection list). I've made
> > multiboxes work fine without the map-backed element, but I
> can't seem to get
> > this to work.
> >
> > I've tried various method signatures in my form bean, but
> to no avail. For
> > example, for a field called "foo" I have tried the following:
> >
> > public void setFoo(String key, Object val)
> > {
> > ...
> > }
> >
> > or
> >
> > public void setFoo(String key, String[] val)
> > {
> > ...
> > }
> >
> > I'm using a set of checkboxes on the JSP which should
> result in a list of the
> > values of whichever boxes are selected. I can think of a
> number of javascript
> > workarounds, as well as workarounds in my Action that go
> directly to the request
> > parameters... but all of those are kludges and it seems
> like there should be a
> > way to have multiple checkboxes that all reference a
> map-backed form property.
> >
> > Any thoughts?
> >
> > thanks a bunch,
> >
> > Mike Nidel
> >
> >
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> "You can lead a horse to water but you cannot make it float
> on its back."
> ~Dakota Jack~
>
> -
> 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]

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


RE: map-backed forms with multibox/multiselect lists?

2005-03-07 Thread Nidel, Mike
This works fine for list-backed form items (which we also use)
but in this case I need something like

public void setFoos(String key, String[] foos)

is this possible?


There are several workarounds I can think of, but this appears
to be the cleanest solution if I can make it work.

Mike

> -Original Message-
> From: Dakota Jack [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 07, 2005 9:42 AM
> To: Struts Users Mailing List
> Subject: Re: map-backed forms with multibox/multiselect lists?
> 
> 
> public void setFoos(String [] foos)
> 
> 
> On Fri, 4 Mar 2005 18:55:53 + (UTC), Mike Nidel 
> <[EMAIL PROTECTED]> wrote:
> > I'm trying to build a form element that combines the 
> features of a map-backed
> > property with a multibox (and the same for a 
> multiple-selection list). I've made
> > multiboxes work fine without the map-backed element, but I 
> can't seem to get
> > this to work.
> > 
> > I've tried various method signatures in my form bean, but 
> to no avail. For
> > example, for a field called "foo" I have tried the following:
> > 
> > public void setFoo(String key, Object val)
> > {
> > ...
> > }
> > 
> > or
> > 
> > public void setFoo(String key, String[] val)
> > {
> > ...
> > }
> > 
> > I'm using a set of checkboxes on the JSP which should 
> result in a list of the
> > values of whichever boxes are selected. I can think of a 
> number of javascript
> > workarounds, as well as workarounds in my Action that go 
> directly to the request
> > parameters... but all of those are kludges and it seems 
> like there should be a
> > way to have multiple checkboxes that all reference a 
> map-backed form property.
> > 
> > Any thoughts?
> > 
> > thanks a bunch,
> > 
> > Mike Nidel
> > 
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> 
> -- 
> "You can lead a horse to water but you cannot make it float 
> on its back."
> ~Dakota Jack~
> 
> -
> 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]



Re: map-backed forms with multibox/multiselect lists?

2005-03-07 Thread Dakota Jack
public void setFoos(String [] foos)


On Fri, 4 Mar 2005 18:55:53 + (UTC), Mike Nidel <[EMAIL PROTECTED]> wrote:
> I'm trying to build a form element that combines the features of a map-backed
> property with a multibox (and the same for a multiple-selection list). I've 
> made
> multiboxes work fine without the map-backed element, but I can't seem to get
> this to work.
> 
> I've tried various method signatures in my form bean, but to no avail. For
> example, for a field called "foo" I have tried the following:
> 
> public void setFoo(String key, Object val)
> {
> ...
> }
> 
> or
> 
> public void setFoo(String key, String[] val)
> {
> ...
> }
> 
> I'm using a set of checkboxes on the JSP which should result in a list of the
> values of whichever boxes are selected. I can think of a number of javascript
> workarounds, as well as workarounds in my Action that go directly to the 
> request
> parameters... but all of those are kludges and it seems like there should be a
> way to have multiple checkboxes that all reference a map-backed form property.
> 
> Any thoughts?
> 
> thanks a bunch,
> 
> Mike Nidel
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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



map-backed forms with multibox/multiselect lists?

2005-03-07 Thread Mike Nidel
I'm trying to build a form element that combines the features of a map-backed
property with a multibox (and the same for a multiple-selection list). I've made
multiboxes work fine without the map-backed element, but I can't seem to get
this to work.

I've tried various method signatures in my form bean, but to no avail. For
example, for a field called "foo" I have tried the following:

public void setFoo(String key, Object val)
{
...
}


or


public void setFoo(String key, String[] val)
{
...
}



I'm using a set of checkboxes on the JSP which should result in a list of the
values of whichever boxes are selected. I can think of a number of javascript
workarounds, as well as workarounds in my Action that go directly to the request
parameters... but all of those are kludges and it seems like there should be a
way to have multiple checkboxes that all reference a map-backed form property.


Any thoughts?

thanks a bunch,

Mike Nidel


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



Re: multibox with label value beans

2005-02-10 Thread Ravi Tadi
 following code will display multobox (Multiple Checkbox) using Label
value bean List.

   






id="checkboxid"
This id will be referd in multibox tag , bean write tag

entries_list : is LabelValue Bean List
selectedEntriesArray : is Array Of String  




On Thu, 10 Feb 2005 11:36:23 -0800, Shey Rab Pawo
<[EMAIL PROTECTED]> wrote:
> I do a dropdown list as follows with a list holding label value beans:
> 
>  
>  property="value"
>  labelProperty="label" />
>  
> 
> How would I put these into a mulit-checkbox?  Thanks for any assistance.
> 
> --
> The radiance of all the stars does not equal a sixteenth part of the
> moon's radiance, likewise, good deeds giving us merit, all these do
> not equal a sixteenth part of the merit of loving-kindness..
> 
> -
> 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]



multibox with label value beans

2005-02-10 Thread Shey Rab Pawo
I do a dropdown list as follows with a list holding label value beans:

  

  

How would I put these into a mulit-checkbox?  Thanks for any assistance.


-- 
The radiance of all the stars does not equal a sixteenth part of the
moon's radiance, likewise, good deeds giving us merit, all these do
not equal a sixteenth part of the merit of loving-kindness..

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



RE: creating a for loop structure for multibox

2004-12-17 Thread David G. Friedman
Frank,

I'll agree with you on not wanting taglibs to be tied directly into Struts.
Why?  Because I like the idea of modularity.  I think this comes from
skimming over struts-chains and thinking (GASP) there are things I could do
without using the traditional struts at all. *shivers in fear AND excitement
at that idea*

Just my $0.02 worth.

Regards,
David

-Original Message-
From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
Sent: Friday, December 17, 2004 5:44 PM
To: Struts Users Mailing List
Subject: Re: creating a for loop structure for multibox


> Well, then you have JSTL... :)
>
> And, struts tags don't require struts.

As I just wrote in another reply :)

Yeah, your right about the Struts tags, but I always worry that there
might be something under the covers that ties it to Struts.  Sure, I
could look at the source, but I've never wanted to know that bad :)

Eh, I knew I was saying something controversial to begin with :)  I'm in
the minority with regard to taglibs, I know that.

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

>>Jim and Frank.
>>
>>Frank W. Zammetti wrote:
>>
>>
>>>Fair enough.  But, now you are tied  pretty securely to
>>
>>Struts.  I'm
>>
>>>not saying that's a bad thing or even a concern to most, but it is
>>>something to be aware of.
>>>
>>>We all strive for separation and low-coupling of everything these
>>>days, and rightly so, and to me that also means the ability
>>
>>to change
>>
>>>frameworks without touching my presentation layer (within some
>>>necessary constraints of course)
>>>
>>>You make perfectly valid points though, so throw it all into the
>>>hopper and make a decision Kedar! :)
>>>
>>
>>
>>-
>>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]
>
>
>
>
>




-
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]



Re: creating a for loop structure for multibox

2004-12-17 Thread Frank W. Zammetti
Well, then you have JSTL... :)
And, struts tags don't require struts.
As I just wrote in another reply :)
Yeah, your right about the Struts tags, but I always worry that there 
might be something under the covers that ties it to Struts.  Sure, I 
could look at the source, but I've never wanted to know that bad :)

Eh, I knew I was saying something controversial to begin with :)  I'm in 
the minority with regard to taglibs, I know that.

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
Jim and Frank.
Frank W. Zammetti wrote:

Fair enough.  But, now you are tied  pretty securely to 
Struts.  I'm 

not saying that's a bad thing or even a concern to most, but it is 
something to be aware of.

We all strive for separation and low-coupling of everything these 
days, and rightly so, and to me that also means the ability 
to change 

frameworks without touching my presentation layer (within some 
necessary constraints of course)

You make perfectly valid points though, so throw it all into the 
hopper and make a decision Kedar! :)


-
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]




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


Re: creating a for loop structure for multibox

2004-12-17 Thread Frank W. Zammetti
It's also fair to tell you that you can do the same thing with JSTL and 
NOT be tied to Struts (assuming you abstract the ActionForm a little and 
don't do anything with it that can't be done with a normal bean later). 
 Kind of a best of both worlds answer I guess, but I think JSTL tends 
to be just a hair more complicated (not much, but a little).

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
Kedar Deshpande wrote:
Both solutions seem like they will do the trick. thank you for giving me 
two choices to deceide from, i guess my choice will be based on wheather 
i want to stick firmly with struts tag or not. thanks for all your help 
Jim and Frank.

Frank W. Zammetti wrote:
Fair enough.  But, now you are tied  pretty securely to Struts.  I'm 
not saying that's a bad thing or even a concern to most, but it is 
something to be aware of.

We all strive for separation and low-coupling of everything these 
days, and rightly so, and to me that also means the ability to change 
frameworks without touching my presentation layer (within some 
necessary constraints of course)

You make perfectly valid points though, so throw it all into the 
hopper and make a decision Kedar! :)


-
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]


RE: creating a for loop structure for multibox

2004-12-17 Thread Jim Barrows


> -Original Message-
> From: Kedar Deshpande [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 17, 2004 3:19 PM
> To: Struts Users Mailing List
> Subject: Re: creating a for loop structure for multibox
> 
> 
> Both solutions seem like they will do the trick. thank you 
> for giving me 
> two choices to deceide from, i guess my choice will be based 
> on wheather 
> i want to stick firmly with struts tag or not. thanks for all 
> your help 

Well, then you have JSTL... :)

And, struts tags don't require struts.

> Jim and Frank.
> 
> Frank W. Zammetti wrote:
> 
> > Fair enough.  But, now you are tied  pretty securely to 
> Struts.  I'm 
> > not saying that's a bad thing or even a concern to most, but it is 
> > something to be aware of.
> >
> > We all strive for separation and low-coupling of everything these 
> > days, and rightly so, and to me that also means the ability 
> to change 
> > frameworks without touching my presentation layer (within some 
> > necessary constraints of course)
> >
> > You make perfectly valid points though, so throw it all into the 
> > hopper and make a decision Kedar! :)
> >
> 
> 
> -
> 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]



Re: creating a for loop structure for multibox

2004-12-17 Thread Kedar Deshpande
Both solutions seem like they will do the trick. thank you for giving me 
two choices to deceide from, i guess my choice will be based on wheather 
i want to stick firmly with struts tag or not. thanks for all your help 
Jim and Frank.

Frank W. Zammetti wrote:
Fair enough.  But, now you are tied  pretty securely to Struts.  I'm 
not saying that's a bad thing or even a concern to most, but it is 
something to be aware of.

We all strive for separation and low-coupling of everything these 
days, and rightly so, and to me that also means the ability to change 
frameworks without touching my presentation layer (within some 
necessary constraints of course)

You make perfectly valid points though, so throw it all into the 
hopper and make a decision Kedar! :)


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


Re: creating a for loop structure for multibox

2004-12-17 Thread Frank W. Zammetti
Fair enough.  But, now you are tied  pretty securely to Struts.  I'm not 
saying that's a bad thing or even a concern to most, but it is something 
to be aware of.

We all strive for separation and low-coupling of everything these days, 
and rightly so, and to me that also means the ability to change 
frameworks without touching my presentation layer (within some necessary 
constraints of course)

You make perfectly valid points though, so throw it all into the hopper 
and make a decision Kedar! :)

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
Jim Barrows wrote:

-Original Message-
From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
Sent: Friday, December 17, 2004 2:14 PM
To: Struts Users Mailing List
Subject: Re: creating a for loop structure for multibox
If I understand correctly, you will get from an Action an 
upper limit to 
the number of checkboxes to display, and you want each checkbox to be 
named 'valueX' where X is the value of the for loop.  Some 
people will 
argue, but I don't see where a taglib is really required here...

<%
  // Assume you got a reference to your action form in af,
  // and that is has a getUpperLimit() method...
  int ul = af.getUpperLimit();
  for (int i = 0; i < ul; i++) {
%>

<%
  }
%>
Not much more than that required.  To make them retain state, you'll 
have to provide some method to determine when a given checkbox is 
checled, and add a checked attribte accordingly, something like:



That'll do the trick, assuming getIsChecked() accepts an 
index value and 
returns a boolean stating whether that particular checkbox is 
checked or 
not.

I have a personal distaste for taglibs in most cases, I know 
many people 
disagree, but I figured you might as well know all your options, then 
you can choose whickever you prefer from an informed position.

And in that spirit:

 

is 4 lines of code
plus the 3 lines of code you'll need in reset.  Plus the i18n ability with no 
additional codeing.
Not to mention being able to hand off the code to the web design folks and have 
them easily make things purty.

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
Jim Barrows wrote:
-Original Message-
From: Kedar Deshpande [mailto:[EMAIL PROTECTED]
Sent: Friday, December 17, 2004 1:52 PM
To: Struts Users Mailing List
Subject: Re: creating a for loop structure for multibox
i am currently using struts tags and cant find a proper 
solution. it 

would be better to have a simple struts code, otherwise i'll 
try to use 
the JSTL.

Then you want the logic:iterate tag.


thank you
Kedar
Jim Barrows wrote:


-Original Message-
From: Kedar Deshpande [mailto:[EMAIL PROTECTED]
Sent: Friday, December 17, 2004 1:21 PM
To: [EMAIL PROTECTED]
Subject: creating a for loop structure for multibox
Could someone please post an example of using a 'for loop' 
structure in 
 

Using JSTL, or Struts tag libs?



a JSP. i need to get the loop limit from the action and 
then assign 

individual 'value' values for a column of checkboxes so 
that i know 

which ones were selected and so that they can be set again 
when viewing 
the page.

thanks

-

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]





-
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]



-
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]



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


Re: creating a for loop structure for multibox

2004-12-17 Thread Wendy Smoak
From: "Kedar Deshpande" <[EMAIL PROTECTED]>
> bu then even if i pass the iterate tag a list of same lenth of required
> number of checkboxes, how would i make sure each checkbox has a unique
> 'value' value so that i know which ones are checked when the form is
> sent to the action?

The List would contain the values.  As you iterate over the List, for each
multibox, the Struts framework will render it as checked if its value
matches one of the values in the String[] that's in the Form bean.

   
   



This uses a Map which is sitting in session scope.  Yours might be a List, I
think any Collection would do. In the example, 'accounts' is a String[]
property of the Form bean.

-- 
Wendy Smoak


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



RE: creating a for loop structure for multibox

2004-12-17 Thread Jim Barrows


> -Original Message-
> From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 17, 2004 2:14 PM
> To: Struts Users Mailing List
> Subject: Re: creating a for loop structure for multibox
> 
> 
> If I understand correctly, you will get from an Action an 
> upper limit to 
> the number of checkboxes to display, and you want each checkbox to be 
> named 'valueX' where X is the value of the for loop.  Some 
> people will 
> argue, but I don't see where a taglib is really required here...
> 
> <%
>// Assume you got a reference to your action form in af,
>// and that is has a getUpperLimit() method...
>int ul = af.getUpperLimit();
>for (int i = 0; i < ul; i++) {
> %>
>  
> <%
>}
> %>
> 
> Not much more than that required.  To make them retain state, you'll 
> have to provide some method to determine when a given checkbox is 
> checled, and add a checked attribte accordingly, something like:
> 
>   <%=af.getIsChecked(i)=true?"checked":"">
> 
> That'll do the trick, assuming getIsChecked() accepts an 
> index value and 
> returns a boolean stating whether that particular checkbox is 
> checked or 
> not.
> 
> I have a personal distaste for taglibs in most cases, I know 
> many people 
> disagree, but I figured you might as well know all your options, then 
> you can choose whickever you prefer from an informed position.

And in that spirit:


 

is 4 lines of code
plus the 3 lines of code you'll need in reset.  Plus the i18n ability with no 
additional codeing.
Not to mention being able to hand off the code to the web design folks and have 
them easily make things purty.

> 
> -- 
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> 
> 
> Jim Barrows wrote:
> > 
> >>-Original Message-
> >>From: Kedar Deshpande [mailto:[EMAIL PROTECTED]
> >>Sent: Friday, December 17, 2004 1:52 PM
> >>To: Struts Users Mailing List
> >>Subject: Re: creating a for loop structure for multibox
> >>
> >>
> >>i am currently using struts tags and cant find a proper 
> solution. it 
> >>would be better to have a simple struts code, otherwise i'll 
> >>try to use 
> >>the JSTL.
> > 
> > 
> > Then you want the logic:iterate tag.
> > 
> > 
> > 
> >>thank you
> >>Kedar
> >>
> >>Jim Barrows wrote:
> >>
> >>
> >>> 
> >>>
> >>>
> >>>>-Original Message-
> >>>>From: Kedar Deshpande [mailto:[EMAIL PROTECTED]
> >>>>Sent: Friday, December 17, 2004 1:21 PM
> >>>>To: [EMAIL PROTECTED]
> >>>>Subject: creating a for loop structure for multibox
> >>>>
> >>>>
> >>>>Could someone please post an example of using a 'for loop' 
> >>>>structure in 
> >>>>   
> >>>>
> >>>
> >>>Using JSTL, or Struts tag libs?
> >>>
> >>>
> >>> 
> >>>
> >>>
> >>>>a JSP. i need to get the loop limit from the action and 
> then assign 
> >>>>individual 'value' values for a column of checkboxes so 
> that i know 
> >>>>which ones were selected and so that they can be set again 
> >>>>when viewing 
> >>>>the page.
> >>>>
> >>>>thanks
> >>>>
> >>>>
> >>
> >>-
> >>
> >>>>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]
> >>>
> >>>
> >>>
> >>>
> >>> 
> >>>
> >>
> >>
> >>
> -
> >>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]
> > 
> > 
> > 
> > 
> > 
> 
> 
> 
> -
> 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]



RE: creating a for loop structure for multibox

2004-12-17 Thread Jim Barrows
>From the struts multibox documentation:
Renders an HTML  element of type checkbox, whose "checked" status is 
initialized based on whether the specified value matches one of the elements of 
the underlying property's array of current values. This element is useful when 
you have large numbers of checkboxes, and prefer to combine the values into a 
single array-valued property instead of multiple boolean properties. This tag 
is only valid when nested inside a form tag body.

WARNING: In order to correctly recognize cases where none of the associated 
checkboxes are selected, the ActionForm bean associated with this form must 
include a statement setting the corresponding array to zero length in the 
reset() method.

The value to be returned to the server, if this checkbox is selected, must be 
defined by one of the following methods:

* Specify a value attribute, whose contents will be used literally as the 
value to be returned.
* Specify no value attribute, and the nested body content of this tag will 
be used as the value to be returned.

so: from j2ee.lagnada.com/struts/multibox-exampl1.htm :

Please select your subscriptions:



 




Submit




> -Original Message-
> From: Kedar Deshpande [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 17, 2004 2:10 PM
> To: Struts Users Mailing List
> Subject: Re: creating a for loop structure for multibox
> 
> 
> bu then even if i pass the iterate tag a list of same lenth 
> of required 
> number of checkboxes, how would i make sure each checkbox has 
> a unique 
> 'value' value so that i know which ones are checked when the form is 
> sent to the action?
> 
> 
> 
> Jim Barrows wrote:
> 
> >  
> >
> >>-Original Message-
> >>From: Kedar Deshpande [mailto:[EMAIL PROTECTED]
> >>Sent: Friday, December 17, 2004 1:52 PM
> >>To: Struts Users Mailing List
> >>Subject: Re: creating a for loop structure for multibox
> >>
> >>
> >>i am currently using struts tags and cant find a proper 
> solution. it 
> >>would be better to have a simple struts code, otherwise i'll 
> >>try to use 
> >>the JSTL.
> >>
> >>
> >
> >Then you want the logic:iterate tag.
> >
> >
> >  
> >
> >>thank you
> >>Kedar
> >>
> >>Jim Barrows wrote:
> >>
> >>
> >>
> >>> 
> >>>
> >>>  
> >>>
> >>>>-Original Message-
> >>>>From: Kedar Deshpande [mailto:[EMAIL PROTECTED]
> >>>>Sent: Friday, December 17, 2004 1:21 PM
> >>>>To: [EMAIL PROTECTED]
> >>>>Subject: creating a for loop structure for multibox
> >>>>
> >>>>
> >>>>Could someone please post an example of using a 'for loop' 
> >>>>structure in 
> >>>>   
> >>>>
> >>>>
> >>>>
> >>>Using JSTL, or Struts tag libs?
> >>>
> >>>
> >>> 
> >>>
> >>>  
> >>>
> >>>>a JSP. i need to get the loop limit from the action and 
> then assign 
> >>>>individual 'value' values for a column of checkboxes so 
> that i know 
> >>>>which ones were selected and so that they can be set again 
> >>>>when viewing 
> >>>>the page.
> >>>>
> >>>>thanks
> >>>>
> >>>>
> >>>>
> >>>>
> >>-
> >>
> >>
> >>>>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]
> >>>
> >>>
> >>>
> >>>
> >>> 
> >>>
> >>>  
> >>>
> >>
> -
> >>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]
> >
> >
> >
> >
> >  
> >
> 
> 
> -
> 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]



Re: creating a for loop structure for multibox

2004-12-17 Thread Frank W. Zammetti
If I understand correctly, you will get from an Action an upper limit to 
the number of checkboxes to display, and you want each checkbox to be 
named 'valueX' where X is the value of the for loop.  Some people will 
argue, but I don't see where a taglib is really required here...

<%
  // Assume you got a reference to your action form in af,
  // and that is has a getUpperLimit() method...
  int ul = af.getUpperLimit();
  for (int i = 0; i < ul; i++) {
%>

<%
  }
%>
Not much more than that required.  To make them retain state, you'll 
have to provide some method to determine when a given checkbox is 
checled, and add a checked attribte accordingly, something like:



That'll do the trick, assuming getIsChecked() accepts an index value and 
returns a boolean stating whether that particular checkbox is checked or 
not.

I have a personal distaste for taglibs in most cases, I know many people 
disagree, but I figured you might as well know all your options, then 
you can choose whickever you prefer from an informed position.

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
Jim Barrows wrote:

-Original Message-
From: Kedar Deshpande [mailto:[EMAIL PROTECTED]
Sent: Friday, December 17, 2004 1:52 PM
To: Struts Users Mailing List
Subject: Re: creating a for loop structure for multibox
i am currently using struts tags and cant find a proper solution. it 
would be better to have a simple struts code, otherwise i'll 
try to use 
the JSTL.

Then you want the logic:iterate tag.

thank you
Kedar
Jim Barrows wrote:



-Original Message-
From: Kedar Deshpande [mailto:[EMAIL PROTECTED]
Sent: Friday, December 17, 2004 1:21 PM
To: [EMAIL PROTECTED]
Subject: creating a for loop structure for multibox
Could someone please post an example of using a 'for loop' 
structure in 
  

Using JSTL, or Struts tag libs?


a JSP. i need to get the loop limit from the action and then assign 
individual 'value' values for a column of checkboxes so that i know 
which ones were selected and so that they can be set again 
when viewing 
the page.

thanks

-
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]




-
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]



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


Re: creating a for loop structure for multibox

2004-12-17 Thread Kedar Deshpande
bu then even if i pass the iterate tag a list of same lenth of required 
number of checkboxes, how would i make sure each checkbox has a unique 
'value' value so that i know which ones are checked when the form is 
sent to the action?


Jim Barrows wrote:
 

-Original Message-
From: Kedar Deshpande [mailto:[EMAIL PROTECTED]
Sent: Friday, December 17, 2004 1:52 PM
To: Struts Users Mailing List
Subject: Re: creating a for loop structure for multibox
i am currently using struts tags and cant find a proper solution. it 
would be better to have a simple struts code, otherwise i'll 
try to use 
the JSTL.
   

Then you want the logic:iterate tag.
 

thank you
Kedar
Jim Barrows wrote:
   


 

-Original Message-
From: Kedar Deshpande [mailto:[EMAIL PROTECTED]
Sent: Friday, December 17, 2004 1:21 PM
To: [EMAIL PROTECTED]
Subject: creating a for loop structure for multibox
Could someone please post an example of using a 'for loop' 
structure in 
  

   

Using JSTL, or Struts tag libs?

 

a JSP. i need to get the loop limit from the action and then assign 
individual 'value' values for a column of checkboxes so that i know 
which ones were selected and so that they can be set again 
when viewing 
the page.

thanks

   

-
   

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]


 

-
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]

 


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


RE: creating a for loop structure for multibox

2004-12-17 Thread Jim Barrows


> -Original Message-
> From: Kedar Deshpande [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 17, 2004 1:52 PM
> To: Struts Users Mailing List
> Subject: Re: creating a for loop structure for multibox
> 
> 
> i am currently using struts tags and cant find a proper solution. it 
> would be better to have a simple struts code, otherwise i'll 
> try to use 
> the JSTL.

Then you want the logic:iterate tag.


> 
> thank you
> Kedar
> 
> Jim Barrows wrote:
> 
> >  
> >
> >>-Original Message-
> >>From: Kedar Deshpande [mailto:[EMAIL PROTECTED]
> >>Sent: Friday, December 17, 2004 1:21 PM
> >>To: [EMAIL PROTECTED]
> >>Subject: creating a for loop structure for multibox
> >>
> >>
> >>Could someone please post an example of using a 'for loop' 
> >>structure in 
> >>
> >>
> >
> >Using JSTL, or Struts tag libs?
> >
> >
> >  
> >
> >>a JSP. i need to get the loop limit from the action and then assign 
> >>individual 'value' values for a column of checkboxes so that i know 
> >>which ones were selected and so that they can be set again 
> >>when viewing 
> >>the page.
> >>
> >>thanks
> >>
> >>
> -
> >>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]
> >
> >
> >
> >
> >  
> >
> 
> 
> -
> 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]



Re: creating a for loop structure for multibox

2004-12-17 Thread Kedar Deshpande
i am currently using struts tags and cant find a proper solution. it 
would be better to have a simple struts code, otherwise i'll try to use 
the JSTL.

thank you
Kedar
Jim Barrows wrote:
 

-Original Message-
From: Kedar Deshpande [mailto:[EMAIL PROTECTED]
Sent: Friday, December 17, 2004 1:21 PM
To: [EMAIL PROTECTED]
Subject: creating a for loop structure for multibox
Could someone please post an example of using a 'for loop' 
structure in 
   

Using JSTL, or Struts tag libs?
 

a JSP. i need to get the loop limit from the action and then assign 
individual 'value' values for a column of checkboxes so that i know 
which ones were selected and so that they can be set again 
when viewing 
the page.

thanks
-
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]

 


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


RE: creating a for loop structure for multibox

2004-12-17 Thread Jim Barrows


> -Original Message-
> From: Kedar Deshpande [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 17, 2004 1:21 PM
> To: [EMAIL PROTECTED]
> Subject: creating a for loop structure for multibox
> 
> 
> Could someone please post an example of using a 'for loop' 
> structure in 

Using JSTL, or Struts tag libs?


> a JSP. i need to get the loop limit from the action and then assign 
> individual 'value' values for a column of checkboxes so that i know 
> which ones were selected and so that they can be set again 
> when viewing 
> the page.
> 
> thanks
> 
> -
> 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]



creating a for loop structure for multibox

2004-12-17 Thread Kedar Deshpande
Could someone please post an example of using a 'for loop' structure in 
a JSP. i need to get the loop limit from the action and then assign 
individual 'value' values for a column of checkboxes so that i know 
which ones were selected and so that they can be set again when viewing 
the page.

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


RE: Multibox & DynaActionForm

2004-12-09 Thread Jaakko Rytinki
Ah.. stupid me =)

So the solution with dynaactionform is:
---
public ActionForward execute(ActionMapping _mapping, ActionForm _form,
HttpServletRequest _request, HttpServletResponse _response) throws
Exception 

{

DynaActionForm dynaForm = (DynaActionForm) _form;

String userId = (String) dynaForm.get("userId");

String[] companies = MyDBTools.getUser(userId).getCompanies();
ArrayList allCompanies = MyDBTools.getAllCompanies();
 
dynaForm.set("selectedCompanies", companies);
_request.setAttribute("allCompanies", allCompanies );

return _mapping.findForward("continue");
}

-Original Message-
From: Robert Taylor [mailto:[EMAIL PROTECTED] 
Sent: 9. joulukuuta 2004 17:13
To: Struts Users Mailing List
Subject: RE: Multibox & DynaActionForm

You will need to set the "selectedCompanies" in the ActionForm
so that the  can determine which companies
have been selected by comparing the company id against the selected
company id.

If "allCompanies" does not change per user, you may want to place that
in 
the ServletContext on application startup to avoid the database hit
everytime that action is executed.

robert

> -Original Message-
> From: Jaakko Rytinki [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 09, 2004 9:14 AM
> To: Struts Users Mailing List
> Subject: Multibox & DynaActionForm
> 
> 
> How I can prepopulate a form containing a multibox when using
> DynaActionForms? The following code doesn't seem to work - it wont
check
> any checkboxes (why?)
> 
> ---
> Action which prepopulates the form:
> ---
> 
> String[] companies = MyDBTools.getUser(userId).getCompanies();
> ArrayList allCompanies = MyDBTools.getAllCompanies();
> 
> _request.setAttribute("selectedCompanies", companies);
> _request.setAttribute("allCompanies", allCompanies );
> 
> ---
> Form
> ---
> 
> 
>   
>   
>
>   
>   
> 
> 
> ---
> Form-bean
> ---
> 
>name="forms.myForm"
>   type="org.apache.struts.validator.DynaValidatorForm">
> 
>type="java.lang.String[]" />
> 
> 
> 
> 
> -
> 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]



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



RE: Multibox & DynaActionForm

2004-12-09 Thread Robert Taylor
You will need to set the "selectedCompanies" in the ActionForm
so that the  can determine which companies
have been selected by comparing the company id against the selected
company id.

If "allCompanies" does not change per user, you may want to place that in 
the ServletContext on application startup to avoid the database hit
everytime that action is executed.

robert

> -Original Message-
> From: Jaakko Rytinki [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 09, 2004 9:14 AM
> To: Struts Users Mailing List
> Subject: Multibox & DynaActionForm
> 
> 
> How I can prepopulate a form containing a multibox when using
> DynaActionForms? The following code doesn't seem to work - it wont check
> any checkboxes (why?)
> 
> ---
> Action which prepopulates the form:
> ---
> 
> String[] companies = MyDBTools.getUser(userId).getCompanies();
> ArrayList allCompanies = MyDBTools.getAllCompanies();
> 
> _request.setAttribute("selectedCompanies", companies);
> _request.setAttribute("allCompanies", allCompanies );
> 
> ---
> Form
> ---
> 
> 
>   
>   
>
>   
>   
> 
> 
> ---
> Form-bean
> ---
> 
>name="forms.myForm"
>   type="org.apache.struts.validator.DynaValidatorForm">
> 
>type="java.lang.String[]" />
> 
> 
> 
> 
> -
> 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]



Multibox & DynaActionForm

2004-12-09 Thread Jaakko Rytinki
How I can prepopulate a form containing a multibox when using
DynaActionForms? The following code doesn't seem to work - it wont check
any checkboxes (why?)

---
Action which prepopulates the form:
---

String[] companies = MyDBTools.getUser(userId).getCompanies();
ArrayList allCompanies = MyDBTools.getAllCompanies();

_request.setAttribute("selectedCompanies", companies);
_request.setAttribute("allCompanies", allCompanies );

---
Form
---




 




---
Form-bean
---








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



RE: Multibox deselection problem

2004-11-26 Thread Seetamraju, Uday
use disabled instead of readonly.
IIRC , HTML rarely uses readonly -- its mostly disabled attribute everywhere.

It works just fine for me.

 

> -Original Message-
> From: Olivier Croisier [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 15, 2004 4:10 AM
> To: Struts Users Mailing List
> Subject: Re: Multibox deselection problem
> 
> 
> Hi !
> 
> Thank you for you help, it works fine now !
> 
> BTW, it seems like Struts does not support all standart HTML 
> options : I had to use a pure HTML  tag because the 
> "readonly" attribute does not exist in Struts, and I think 
> this mix is a bit dirty. But it works...
> ("onLoad" not supported either...)
> 
> Olivier Croisier
> 
> 
> > This is a problem with HTTP: when all the checkboxes are 
> deselected, the
> > browser doesn't send anything back, so you get the default 
> of what you
> > started with. To solve this problem you must ensure that at 
> least one box is
> > always selected.
> >
> > I solved this problem by creating an additional checkbox 
> that is hidden,
> > read-only and selected. This will ensure that the browser 
> sends something
> > back.
> >
> > String[] defaultEntities = {"A", "B", "C", "D", "filler"};
> >
> >  > value="filler"/>
> >
> > Wiebe
> >
> > -Original Message-
> > From: Olivier Croisier [mailto:[EMAIL PROTECTED]
> > Sent: Friday, November 12, 2004 6:47 AM
> > To: [EMAIL PROTECTED]
> > Subject: Multibox deselection problem
> >
> > Hi !
> >
> > I have a problem with the Multibox behaviour. I have 
> checked the online doc
> > but nothing helped me so far... Here is my problem :
> >
> > My app workflow is :
> > prepareImportAction.do  ->  Import.jsp  ->  processImportAction.do
> >
> > In the prepareImportAction.do, I initialize the "entities" 
> var (of type
> > String[], in session scope), so that the checkboxes are 
> checked by default
> > when the jsp page is displayed :
> > String[] defaultEntities = {"A", "B", "C", "D"};
> > myform.set("entities", defaultEntities);
> >
> > In the jsp page, I have a set of :
> > 
> > 
> > 
> > 
> >
> > I also have a small javascript that allows the user to 
> select or deselect
> > all checkboxes in one click :
> > function checkAll(field)
> > {   var i;
> > for (i=0;i > {   field[i].checked=true;   }
> > }
> > (nearly the same for de-selecting all checkboxes)
> >
> > Now here is my problem. When I de-select all the checkboxes 
> in my jsp page,
> > by hand or by javascript, my processImport.do receives a 
> String[] array
> > containing the entities that were defined in 
> preparaImport.do as default,
> > instead of an empty array.
> > This only happens only when all entities are deselected : 
> if a single one is
> > selected, I get the desired behaviour.
> >
> > May you help me to understand where I am wrong and why it 
> doesn't work
> > please?
> >
> > Olivier Croisier
> >
> 
> 
> 
> -- 
> CROISIER Olivier
> Software Engineer
> Thales IS - ANS
> [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>
 
 
 


 
The information contained in this message is intended only for the recipient, 
and may be a confidential attorney-client communication or may otherwise be 
privileged and confidential and protected from disclosure. If the reader of 
this message is not the intended recipient, or an employee or agent responsible 
for delivering this message to the intended recipient, please be aware that any 
dissemination or copying of this communication is strictly prohibited. If you 
have received this communication in error, please immediately notify us by 
replying to the message and deleting it from your computer.
 
Thank you,
 
Standard & Poor's
 


 

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



RE: Multibox deselection problem

2004-11-26 Thread Seetamraju, Uday
For simple use-n-throw (non-dynaforms?) forms, a much better *generic* solution 
:-

At the VERY BOTTOM (please note the caps to get your attention ;-) ) of the JSP 
that displays the form :-

<%  MyForm frm = (MyForm) request.getAttribute("formname");
frm.reset();
%>

In scenarios where the user can "temporarily" navigate to other pages and comes 
BACK to this page the user will find all values gone...
So, it works wonderfully ONLY for use-n-throw forms.
>From my experience, forms with such checkboxes are not on the 'main page' 
>(that the user keeps coming back to for all screen flows).

All my forms are explicit bean-classes, -- others can let you know if reset() 
works on dynaforms.
And do not forget to code your reset() function.


> -Original Message-
> From: Wiebe de Jong [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 12, 2004 12:59 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Multibox deselection problem
> 
> 
> This is a problem with HTTP: when all the checkboxes are 
> deselected, the
> browser doesn't send anything back, so you get the default of what you
> started with. To solve this problem you must ensure that at 
> least one box is
> always selected.
> 
> I solved this problem by creating an additional checkbox that 
> is hidden,
> read-only and selected. This will ensure that the browser 
> sends something
> back.
> 
> String[] defaultEntities = {"A", "B", "C", "D", "filler"};
> 
>  value="filler"/>
> 
> Wiebe
> 
> -Original Message-
> From: Olivier Croisier [mailto:[EMAIL PROTECTED] 
> Sent: Friday, November 12, 2004 6:47 AM
> To: [EMAIL PROTECTED]
> Subject: Multibox deselection problem
> 
> Hi !
> 
> I have a problem with the Multibox behaviour. I have checked 
> the online doc
> but nothing helped me so far... Here is my problem :
> 
> My app workflow is :
> prepareImportAction.do  ->  Import.jsp  ->  processImportAction.do
> 
> In the prepareImportAction.do, I initialize the "entities" 
> var (of type
> String[], in session scope), so that the checkboxes are 
> checked by default
> when the jsp page is displayed :
>   String[] defaultEntities = {"A", "B", "C", "D"};
>   myform.set("entities", defaultEntities);
> 
> In the jsp page, I have a set of :
>   
>   
>   
>   
> 
> I also have a small javascript that allows the user to select 
> or deselect
> all checkboxes in one click :
>   function checkAll(field)
>   {   var i;
>   for (i=0;i   {   field[i].checked=true;   }
>   }
> (nearly the same for de-selecting all checkboxes)
> 
> Now here is my problem. When I de-select all the checkboxes 
> in my jsp page,
> by hand or by javascript, my processImport.do receives a 
> String[] array
> containing the entities that were defined in preparaImport.do 
> as default,
> instead of an empty array.
> This only happens only when all entities are deselected : if 
> a single one is
> selected, I get the desired behaviour.
> 
> May you help me to understand where I am wrong and why it doesn't work
> please?
> 
> Olivier Croisier
> 
> -- 
> CROISIER Olivier
> Software Engineer
> Thales IS - ANS
> [EMAIL PROTECTED]
> 
> -
> 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]
> 
>
 
 
 


 
The information contained in this message is intended only for the recipient, 
and may be a confidential attorney-client communication or may otherwise be 
privileged and confidential and protected from disclosure. If the reader of 
this message is not the intended recipient, or an employee or agent responsible 
for delivering this message to the intended recipient, please be aware that any 
dissemination or copying of this communication is strictly prohibited. If you 
have received this communication in error, please immediately notify us by 
replying to the message and deleting it from your computer.
 
Thank you,
 
Standard & Poor's
 


 

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



Re: Multibox deselection problem

2004-11-15 Thread Olivier Croisier
Hi !
Thank you for you help, it works fine now !
BTW, it seems like Struts does not support all standart HTML options : I had to use a pure HTML 
 tag because the "readonly" attribute does not exist in Struts, and I 
think this mix is a bit dirty. But it works...
("onLoad" not supported either...)
Olivier Croisier

This is a problem with HTTP: when all the checkboxes are deselected, the
browser doesn't send anything back, so you get the default of what you
started with. To solve this problem you must ensure that at least one box is
always selected.
I solved this problem by creating an additional checkbox that is hidden,
read-only and selected. This will ensure that the browser sends something
back.
String[] defaultEntities = {"A", "B", "C", "D", "filler"};

Wiebe
-Original Message-
From: Olivier Croisier [mailto:[EMAIL PROTECTED]
Sent: Friday, November 12, 2004 6:47 AM
To: [EMAIL PROTECTED]
Subject: Multibox deselection problem
Hi !
I have a problem with the Multibox behaviour. I have checked the online doc
but nothing helped me so far... Here is my problem :
My app workflow is :
prepareImportAction.do  ->  Import.jsp  ->  processImportAction.do
In the prepareImportAction.do, I initialize the "entities" var (of type
String[], in session scope), so that the checkboxes are checked by default
when the jsp page is displayed :
String[] defaultEntities = {"A", "B", "C", "D"};
myform.set("entities", defaultEntities);
In the jsp page, I have a set of :




I also have a small javascript that allows the user to select or deselect
all checkboxes in one click :
function checkAll(field)
{   var i;
for (i=0;i
Now here is my problem. When I de-select all the checkboxes in my jsp page,
by hand or by javascript, my processImport.do receives a String[] array
containing the entities that were defined in preparaImport.do as default,
instead of an empty array.
This only happens only when all entities are deselected : if a single one is
selected, I get the desired behaviour.
May you help me to understand where I am wrong and why it doesn't work
please?
Olivier Croisier

--
CROISIER Olivier
Software Engineer
Thales IS - ANS
[EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Multibox deselection problem

2004-11-13 Thread Rick Reumann
Olivier Croisier wrote the following on 11/12/2004 9:46 AM:
Now here is my problem. When I de-select all the checkboxes in my jsp 
page, by hand or by javascript, my processImport.do receives a String[] 
array containing the entities that were defined in preparaImport.do as 
default, instead of an empty array.
Use the form reset method to always set the String array to an empty 
array first.

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


RE: Multibox deselection problem

2004-11-12 Thread Wiebe de Jong
This is a problem with HTTP: when all the checkboxes are deselected, the
browser doesn't send anything back, so you get the default of what you
started with. To solve this problem you must ensure that at least one box is
always selected.

I solved this problem by creating an additional checkbox that is hidden,
read-only and selected. This will ensure that the browser sends something
back.

String[] defaultEntities = {"A", "B", "C", "D", "filler"};



Wiebe

-Original Message-
From: Olivier Croisier [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 12, 2004 6:47 AM
To: [EMAIL PROTECTED]
Subject: Multibox deselection problem

Hi !

I have a problem with the Multibox behaviour. I have checked the online doc
but nothing helped me so far... Here is my problem :

My app workflow is :
prepareImportAction.do  ->  Import.jsp  ->  processImportAction.do

In the prepareImportAction.do, I initialize the "entities" var (of type
String[], in session scope), so that the checkboxes are checked by default
when the jsp page is displayed :
String[] defaultEntities = {"A", "B", "C", "D"};
myform.set("entities", defaultEntities);

In the jsp page, I have a set of :





I also have a small javascript that allows the user to select or deselect
all checkboxes in one click :
function checkAll(field)
{   var i;
for (i=0;i

Multibox deselection problem

2004-11-12 Thread Olivier Croisier
Hi !
I have a problem with the Multibox behaviour. I have checked the online doc but 
nothing helped me so far... Here is my problem :
My app workflow is :
prepareImportAction.do  ->  Import.jsp  ->  processImportAction.do
In the prepareImportAction.do, I initialize the "entities" var (of type 
String[], in session scope), so that the checkboxes are checked by default when the jsp 
page is displayed :
String[] defaultEntities = {"A", "B", "C", "D"};
myform.set("entities", defaultEntities);
In the jsp page, I have a set of :




I also have a small javascript that allows the user to select or deselect all 
checkboxes in one click :
function checkAll(field)
{   var i;
for (i=0;i
Now here is my problem. When I de-select all the checkboxes in my jsp page, by 
hand or by javascript, my processImport.do receives a String[] array containing 
the entities that were defined in preparaImport.do as default, instead of an 
empty array.
This only happens only when all entities are deselected : if a single one is 
selected, I get the desired behaviour.
May you help me to understand where I am wrong and why it doesn't work please?
Olivier Croisier
--
CROISIER Olivier
Software Engineer
Thales IS - ANS
[EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


SV: Multibox problem

2004-11-03 Thread Roland Carlsson
Hi Robert!

Thanks for your answer. It pointed me to the problem. I used the add instead
of addAll of the Collection-interface. So instead of adding the elements
(Strings) I added the collection as a collection.

Regards
Roland Carlsson


Den 04-11-03 11.50, skrev "Robert Taylor" <[EMAIL PROTECTED]>:

> How many items are in the "func" data structure in request scope?
> This is what drives the number of iterations.
> 
> robert
> 
>> -Original Message-
>> From: Roland Carlsson [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, November 03, 2004 5:02 AM
>> To: Struts Users Mailing List
>> Subject: Multibox problem
>> 
>> 
>> Hi!
>> 
>> I'm trying to create a set of checkboxes with the MulitBox-tag.
>> 
>> The problem is that I get an extra checkbox with brackets around its value,
>> like in this html-code where I expect two checkboxes but get three:
>> 
>> 
>>[test, prov] 
>> 
>>prov 
>> 
>>test 
>> 
>> 
>> My page has this code inside it: ("funk" are a Collection stored in the
>> request, "filedata" has the property "functions" that also is a Collection)
>> 
>> 
>>   
>>
>>   
>>
>> 
>> 
>> Could you please point out why I get this extra checkbox
>> 
>> Thanks in advance
>> Roland Carlsson
>> 
>> 
>> ps: I have looked in the arcives but it says it doesn't support textsearch
>> 
>> 
>> -
>> 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]
> 


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



RE: Multibox problem

2004-11-03 Thread Robert Taylor
How many items are in the "func" data structure in request scope?
This is what drives the number of iterations.

robert

> -Original Message-
> From: Roland Carlsson [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 03, 2004 5:02 AM
> To: Struts Users Mailing List
> Subject: Multibox problem
> 
> 
> Hi!
> 
> I'm trying to create a set of checkboxes with the MulitBox-tag.
> 
> The problem is that I get an extra checkbox with brackets around its value,
> like in this html-code where I expect two checkboxes but get three:
> 
> 
>[test, prov] 
> 
>prov 
> 
>test 
> 
> 
> My page has this code inside it: ("funk" are a Collection stored in the
> request, "filedata" has the property "functions" that also is a Collection)
> 
> 
>   
>
>
>
> 
> 
> Could you please point out why I get this extra checkbox
> 
> Thanks in advance
> Roland Carlsson
> 
> 
> ps: I have looked in the arcives but it says it doesn't support textsearch
> 
> 
> -
> 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]



Multibox problem

2004-11-03 Thread Roland Carlsson
Hi!

I'm trying to create a set of checkboxes with the MulitBox-tag.

The problem is that I get an extra checkbox with brackets around its value,
like in this html-code where I expect two checkboxes but get three:


   [test, prov] 

   prov 

   test 


My page has this code inside it: ("funk" are a Collection stored in the
request, "filedata" has the property "functions" that also is a Collection)


  
   
   
   


Could you please point out why I get this extra checkbox

Thanks in advance
Roland Carlsson


ps: I have looked in the arcives but it says it doesn't support textsearch


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



conditional multibox validation using validwhen

2004-10-30 Thread xml spy
I am trying to use validwhen with html multibox in
struts tag.

In my JSP I am using

a) A html:multibox which renders 4 check boxes for me
(using iterate tag). 
In my ActionForm this multibox property stores values
to a "String Array" property name "reasons" 

And

b) A text field of property name "dispatch"
 - This textfield "dispatch" will have only 2 string
values 
Either “process" or "reject" (assume it gets
dynamically assigned these String values)

All I want to do is that to ensure no checkboxes are
checked when the text field dispatch=="process"

AND

All (or) at least one check box is checked when
dispatch=="reject"

I am aware of some integer comparison bug with 1.2.4
while using validwhen.

Now I am using 1.2.5 but none of my combinations seem
to work.

One of the combinations I tried is below mentioned.
This nearly works but does not ensure the checkboxes
are checked when dispatch=="reject"




test
(((dispatch == "process") and (*this* ==
null)) or ((dispatch == "reject") and (*this* !=
null)))



NOTE: for some reason when I submit these 4 checkboxes
"UNCHECKED", they seem to be *NOT* NULL. They get
initialized to a zero length array. I am not
initializing the "reasons" property in the
struts-config.xml. So this property must be
initialized to null, which happens all fine. But when
empty unchecked check boxes are submitted the
"reasons" property is no more null but a zero length
array.

I would really appreciate if someone can just reply me
with a solution.

Many thanks in advance.





___ALL-NEW Yahoo! Messenger - 
all new features - even more fun! http://uk.messenger.yahoo.com

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



multibox validation using validwhen

2004-10-30 Thread xml spy
I am trying to use validwhen with html multibox in
struts tag.
In my JSP I am using
a) a html:multibox which renders 4 check boxes for me
(using iterate tag). 
In my actionform this multibox property stores values
to a "String Array" property name "reasons" 
and
b) a text field of property name "dispatch"
 - this textfield "dispatch" will have only 2 string
values 
 Either  "process" or "reject" (assume it gets
dynamically assigned these String values)

all i want to do is that to ensure
no checkboxes are checked when the text field
dispatch=="process"
and
All (or) atleast one check box is checked when
dispatch=="reject"

I am aware of some integer comparison bug with 1.2.4
while using validwhen.
now am using 1.2.5 but none of my combinations seem to
work.
One of the combinations I tried is below mentioned.
This nearly works but does not ensure the checkboxes
are checked when dispatch=="reject"



test
(((dispatch == "process") and (*this* ==
null)) or ((dispatch == "reject") and (*this* !=
null)))


 
NOTE: for some reason when I submit these 4 checkboxes
"UNCHECKED", they seem to be *NOT* NULL. They get
initialized to a zero length array. I am not
initializing the "reasons" property in the
struts-config.xml. So this property must be
initialized to null, which happens all fine. But when
empty unchecked check boxes are submitted the
"reasons" property is no more null but a zero length
array.
 
I would really appreciate if someone can just reply me
with a solution.
 
Many thanks in advance.






___ALL-NEW Yahoo! Messenger - 
all new features - even more fun! http://uk.messenger.yahoo.com

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



Re: DynaValidatorForm and multibox

2004-10-19 Thread Wendy Smoak
From: "Brian Kuhn" <[EMAIL PROTECTED]>
> I'm using struts 1.1
> Is it possible to use a multibox with a DynaValidatorForm?

Sure.  I use a String[] property in the dynamic form, and it works fine.

If you're having trouble with it, post the relevant parts of the config
files and JSP and someone will take a look.

-- 
Wendy Smoak


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



DynaValidatorForm and multibox

2004-10-19 Thread Brian Kuhn
I'm using struts 1.1
Is it possible to use a multibox with a DynaValidatorForm?  

Are there any documented examples?  I searched the archives...no mention of it.

Thanks,
  Brian

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



RE: Help! Questions about Checkbox and multibox

2004-10-13 Thread Freddy Villalba A.
Hi t,

I'm having my own problems with checkboxes / multiboxes. However, I think I
can help u a bit with some of those questions.

- When you check a box and submit it, the value that gets submitted is the
one on the value attribute of that checkbox.

- When you check more than one checkbox with the same "name", you'll need an
array-type property for Struts handling it properly. Each position on the
array generated (setXXX-ed) by Struts will be the value of a checked box.

- I haven't actually implemented this lately, but I believe that, in case
your screen is the kind that refresh itself after the post (i.e. no post /
redirect technique being used), then you might have to reset the array on
the reset() method of the corresponding actionForm. In any case, you might
want to check Struts' web site for more info on this issue.

HTH,
Freddy-

-Mensaje original-
De: t t [mailto:[EMAIL PROTECTED]
Enviado el: miercoles, 13 de octubre de 2004 3:31
Para: [EMAIL PROTECTED]
Asunto: Help! Questions about Checkbox and multibox


Hi, all,

I have some questions regarding Checkbox and multibox:

1. What value will be returned if a checkbox is
checked? How to get it from the relevant form bean?
any example?

2. If I want to check a group of checkboxes (multibox)
after a single checkbox is checked, how to do that? I
guess javascript will be a good way, but in java
script, how to get the reference of checkbox and
multibox defined by struts ? any example?

Thanks in advance!
Tong

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

-
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]



Help! Questions about Checkbox and multibox

2004-10-12 Thread t t
Hi, all,

I have some questions regarding Checkbox and multibox:

1. What value will be returned if a checkbox is
checked? How to get it from the relevant form bean?
any example?

2. If I want to check a group of checkboxes (multibox)
after a single checkbox is checked, how to do that? I
guess javascript will be a good way, but in java
script, how to get the reference of checkbox and
multibox defined by struts ? any example?

Thanks in advance!
Tong

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



multibox indexed

2004-09-10 Thread Claudia Woestheinrich
Hello,

I have a big Problem with reading the values of the text-field in
the iterate-tag.
The Value with the ID=1 is all time wrong! and the athers are
ok.?
The Value with the index=1 is all time the value of the
initialisation and not the
changed.

My JSP:

.
 


 


" size="2"/>


 

My ActionForm:

  public LabelValueBean getLabelValue(int index){
return beans[index];
}

public void setLabels(LabelValueBean[] beans){
this.beans=beans;
   }

public void setSelDDE(String[] selDDE){
this.selDDE=selDDE;
}

public String[] getSelDDE(){
return selDDE;
}

In the ActionClass befor show the JSP I write the LabelValueBeans:

LabelValueBean[] beans=new LabelValueBean[enten.size()];
 for(int i=0;i

Re: Antwort: Re: problem with multibox

2004-09-07 Thread Deepak
 Form:
--- 
 public ArrayList getTest() {
return mTest;
  }

  public void setTest(ArrayList test) {
mTest = test;
  }

  public Item getItem(int i) {
return (Item)mTest.get(i);
  }

  private ArrayList mTest;
  
JSP:
-







- Original Message - 
From: "Claudia Woestheinrich" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, September 07, 2004 4:29 PM
Subject: Antwort: Re: problem with multibox


> 
> ..Thanks that works.
> 
> Now I have  in the JSP-Page checkboxes and textfields. I want to
> write
> the two values (test,info) in an Map or Array[][]. How must I do
> this
> in the ActionForm?
> 
> Thanks
> Claudia
> 
> My JSP:
> 
> 
>  
> 
>  
>  
> 
> 
> 
> 
> -
> 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]



Antwort: Re: problem with multibox

2004-09-07 Thread Claudia Woestheinrich

..Thanks that works.

Now I have  in the JSP-Page checkboxes and textfields. I want to
write
the two values (test,info) in an Map or Array[][]. How must I do
this
in the ActionForm?

Thanks
Claudia

My JSP:


 

 
 




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



Re: problem with multibox

2004-09-07 Thread Deepak
Try,





   

   
 

- Original Message - 
From: "Claudia Woestheinrich" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 07, 2004 1:21 PM
Subject: problem with multibox


> Hi,
> 
> I have a Problem with using multiboxes. I want to generate following
> HTML-Code:
> 
> Ronja
> Petra
> Heini
> 
> But I became:
> 2002 Ronja
> 2003 Petra
> 2004 Heini
> 
> What must I do???
> Thanks
> Claudia
> 
> My JSP-Code:
> 
>  
> 
> 
> 
> 
> 
>
> 
> 
> 
>
> 
> 
> And my ActionForm:
> 
> public class MyForm extends ActionForm{
> 
> /** Creates a new instance of MyForm */
> public MyForm() {
> MyBean eins=new MyBean();
> eins.setJahr("2002");
> eins.setName("Ronja");
> 
> MyBean zwei=new MyBean();
> zwei.setJahr("2003");
> zwei.setName("Petra");
> 
> MyBean drei=new MyBean();
> drei.setJahr("2004");
> drei.setName("Heini");
> 
> init=new Object[3];
> init[0]=eins;
> init[1]=zwei;
> init[2]=drei;
> 
> 
> }
> 
> private Object[] items, init,sel;
> 
> 
> public Object[] getItems(){
> return items;
> }
> 
> public void setItems(Object[] v){
> items=v;
> }
> 
> public Object[] getSel(){
> return sel;
> }
> 
> public void setSel(Object[] selected){
> sel=selected;
> }
> 
> 
> 
> public void reset(ActionMapping mapping,HttpServletRequest req){
> System.out.println("bin in reset");
> 
> items=new Object[3];
> items=init;
> 
> }
> 
> }
> 
> 
> -
> 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]



problem with multibox

2004-09-07 Thread Claudia Woestheinrich
Hi,

I have a Problem with using multiboxes. I want to generate following
HTML-Code:

Ronja
Petra
Heini

But I became:
2002 Ronja
2003 Petra
2004 Heini

What must I do???
Thanks
Claudia

My JSP-Code:

 





   



   


And my ActionForm:

public class MyForm extends ActionForm{

/** Creates a new instance of MyForm */
public MyForm() {
MyBean eins=new MyBean();
eins.setJahr("2002");
eins.setName("Ronja");

MyBean zwei=new MyBean();
zwei.setJahr("2003");
zwei.setName("Petra");

MyBean drei=new MyBean();
drei.setJahr("2004");
drei.setName("Heini");

init=new Object[3];
init[0]=eins;
init[1]=zwei;
init[2]=drei;


}

private Object[] items, init,sel;


public Object[] getItems(){
return items;
}

public void setItems(Object[] v){
items=v;
}

public Object[] getSel(){
return sel;
}

public void setSel(Object[] selected){
sel=selected;
}



public void reset(ActionMapping mapping,HttpServletRequest req){
System.out.println("bin in reset");

items=new Object[3];
items=init;

}

}


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



Re: Multibox/LabelValueBean Input Forms -- Paged Input

2004-06-10 Thread Niall Pemberton
The logic iterate tag has "offset" and "length" attributes which you can use
to control display subsets to a collection/array.

So if you wanted to show the second page of 10




 





If you are using jstl then then  tag has "begin" and "end"
attributes




 




Niall

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 11, 2004 1:47 AM
Subject: Multibox/LabelValueBean Input Forms -- Paged Input


> I have found an example on the net where a LabelValueBean array and a
string
> array are encapsulated inside a custom ActionForm object giving the user
the
> ability to select checkboxed values and store the "values" behind the
scene
> with labeling each checkbox with the LabelValueBean's label property.
>
> This works great for small amounts of checkbox input, such as less than
10;
> however the goal I have been tasked with is to expand on this where the
data
> set is say 100 elements and each form page displays a subset of 10 items
of
> the entire 100 element data set.
>
> Once the user has traversed through all 100 items or selected those they
wish,
> the form should contain an array of items that range the entire 100
element
> dataset which the user has selected.
>
> Any thoughts, suggestions, or examples of something like this others have
done
> in the past?
>
> Chris
>
>
> -
> 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]



Multibox/LabelValueBean Input Forms -- Paged Input

2004-06-10 Thread chris . cranford
I have found an example on the net where a LabelValueBean array and a string 
array are encapsulated inside a custom ActionForm object giving the user the 
ability to select checkboxed values and store the "values" behind the scene
with labeling each checkbox with the LabelValueBean's label property.

This works great for small amounts of checkbox input, such as less than 10; 
however the goal I have been tasked with is to expand on this where the data 
set is say 100 elements and each form page displays a subset of 10 items of 
the entire 100 element data set.

Once the user has traversed through all 100 items or selected those they wish, 
the form should contain an array of items that range the entire 100 element 
dataset which the user has selected.

Any thoughts, suggestions, or examples of something like this others have done 
in the past?

Chris 


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



Multibox combined with other fields

2004-06-08 Thread Guillermo Meyer
Hi:

I have a form that may contain one or more "rows". Each row has a
passenger data. All the passengers in the form consists in a
reservation:

Number  Title   NameExtraSeat
CabinBaggage

1   Mr  Carlos Gardel   Yes(1)  No(1)
2   Mr  J.Manuel Fangio No(2)   No(2)
3   Mr  Guillermo Vilas No(3)   No(3)
4   Mr  Diego Maradona  Yes(4)  Yes(4)


ExtraSeat and CabinBaggage uses multiboxes and should be boolean values.
When I submit this form, the multiboxes that are checked are sent, but
the unchecked arent.

When posted, I receive arrays of string with:

Number={"1", "2", "3", "4"}
Title={"Mr", "Mr", "Mr", "Mr"}
Name={"Carlos Gardel", "J.Manuel Fangio", "Guillermo Vilas", "Diego
Maradona"}
ExtraSeat={"1", "4"}
CabinBaggage={"4"}

What is the usual solution for this using plain struts?
Do i should calculate the "missing" extraseat and cabinbaggage in the
reset form?
Is there any "helper" class for completing the missing non posted
checkboxes to indicate true or false in that porperties?

In fact, i should need to have this arrays in order proceed in
persisting this reservation:

Number={"1", "2", "3", "4"}
Title={"Mr", "Mr", "Mr", "Mr"}
Name={"Carlos Gardel", "J.Manuel Fangio", "Guillermo Vilas", "Diego
Maradona"}
ExtraSeat={true, false, false, true}
CabinBaggage={false, false, false, true}

Thanks in advance.

Guillermo Meyer
System Engineer
EDS Argentina - Proyecto X71 Interbanking.
54.11.4322-1307

NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las 
personas direccionadas en el mail y puede contener informacion (i)de propiedad 
exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier 
opinion en el contenido, es exclusiva de su autor y no representa necesariamente la 
opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion 
esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna 
por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha 
recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo 
inmediatamente junto con todas las copias del mismo, notificando al remitente. No 
debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus 
partes si usted no es el destinatario. Muchas gracias.



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



Re: Can I use multibox with text fields?

2004-06-02 Thread atta-ur rehman
Hello Miguel,

You might want to search the archive for "indexed properties"; I think
that's what you're looking for.

HTH,

ATTA

- Original Message - 
From: "Miguel Arroz" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, June 02, 2004 4:04 PM
Subject: Can I use multibox with text fields?


> Hi!
>
>I need to display a page that loads a list of items from a DB, and
> that displays that list, with a text field and a checkbox per row. The
> checkbox is easy to do, using multibox. But how can I get the text
> field? Can I use something like multibox (and then read all the text
> boxes from an array), or do I have to do this manually (using iterate,
> etc)?
>
>Yours
>
> Miguel Arroz
>
>   Fire, walk with me.
>
>Miguel Arroz - [EMAIL PROTECTED] - http://www.guiamac.com
>
>
> -
> 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]



Can I use multibox with text fields?

2004-06-02 Thread Miguel Arroz
Hi!
  I need to display a page that loads a list of items from a DB, and 
that displays that list, with a text field and a checkbox per row. The 
checkbox is easy to do, using multibox. But how can I get the text 
field? Can I use something like multibox (and then read all the text 
boxes from an array), or do I have to do this manually (using iterate, 
etc)?

  Yours
Miguel Arroz
 Fire, walk with me.
  Miguel Arroz - [EMAIL PROTECTED] - http://www.guiamac.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: multibox mayhem

2004-06-02 Thread Irfandhy Franciscus
from this code : 
I guess that bean1 must be an object inside 'allofem'
So why are you trying to iterate an object :

pls wrote:
i had to add  tags around the 
because there were some trailing 'null' values in the Integer[] after
reading from DB.
"pls" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I have one multibox per page on a few pages.
Each page name is represented by the 'key' property of a HashMap.
Each selected checkbox number is stored in Integer[]'s in the 'value'
property of a HashMap.
After selecting all of the checks, the user is forwarded to a
confirmation.jsp which displays the selections.
the code: (i removed table formatting for clarity)

  
  
 
  

this works fine to display the selections when they are read from the
original ActionForm.
i can update the db and then read them back which works fine too.
i have confirmed that i have a HashMap with the correct Integer[]'s from
the
db inside,
however the same code as the previous
is located in profile.jsp and it returns the following JasperException:
"Cannot find bean bean2 in any scope"
Any ideas?  Thanks.

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


Re: multibox mayhem

2004-06-02 Thread pls
i had to add  tags around the 
because there were some trailing 'null' values in the Integer[] after
reading from DB.

"pls" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have one multibox per page on a few pages.
> Each page name is represented by the 'key' property of a HashMap.
> Each selected checkbox number is stored in Integer[]'s in the 'value'
> property of a HashMap.
>
> After selecting all of the checks, the user is forwarded to a
> confirmation.jsp which displays the selections.
> the code: (i removed table formatting for clarity)
>
> 
>
>
>   
>
> 
>
> this works fine to display the selections when they are read from the
> original ActionForm.
> i can update the db and then read them back which works fine too.
> i have confirmed that i have a HashMap with the correct Integer[]'s from
the
> db inside,
>
> however the same code as the previous
> is located in profile.jsp and it returns the following JasperException:
> "Cannot find bean bean2 in any scope"
>
> Any ideas?  Thanks.




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



multibox mayhem

2004-06-02 Thread pls
I have one multibox per page on a few pages.
Each page name is represented by the 'key' property of a HashMap.
Each selected checkbox number is stored in Integer[]'s in the 'value'
property of a HashMap.

After selecting all of the checks, the user is forwarded to a
confirmation.jsp which displays the selections.
the code: (i removed table formatting for clarity)


   
   
  
   


this works fine to display the selections when they are read from the
original ActionForm.
i can update the db and then read them back which works fine too.
i have confirmed that i have a HashMap with the correct Integer[]'s from the
db inside,

however the same code as the previous
is located in profile.jsp and it returns the following JasperException:
"Cannot find bean bean2 in any scope"

Any ideas?  Thanks.




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



RE: JSTL and Multibox Submit Problem (SOLVED)

2004-05-25 Thread Ricardo Cortes
That makes sense.  I'm not sure why I didn't think of that.  I guess I was assuming 
the  would take care of the form submission since it was embedded in an 
.  So, I've added an onclick attribute to my  as follows and it 
worked just fine:

delete

Voila!  (It's the French Open this week.)

Thanks Richard.

-Original Message-
From: Richard Yee [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 25, 2004 11:36 AM
To: Struts Users Mailing List
Subject: Re: JSTL and Multibox Submit Problem


Ricardo,
If you are going to use the html:link tag, then you
need to have it trigger a call to a JavaScript
function that will submit the form for you. Otherwise,
jjust clicking the link will not submit the form.

Regards,

Richard

--- Ricardo Cortes <[EMAIL PROTECTED]> wrote:
> Hi there,
> 
> I am having a problem getting the checked values
> from a multibox that is submitted to my action and I
> was hoping one of you could help me out.  I followed
> Ted Husted's example of using a Multibox within an
> iteration but I have a feeling that my setup is a
> bit different and thus renders a different solution.
>  I'm using a JSTL forEach loop to loop through a
> list of MessageInstance objects.  I want the user to
> be able to check which MessageInstances should be
> deleted and the action to perform the deletion. 
> Everything gets rendered ok but when the form is
> submitted, the String[] object in the form is empty.
>  I should also note that everything works fine if I
> use an html:submit but when I try to use an
> html:link to do the submit I don't get any checked
> values in my String[] object.  I've included some
> code snippets below.  Any help would be awesome.
> 
> Thanks!
> Ricardo
> 
> JSP:
> ===
> 
>   Submit Link (inside ManageNotesForm):
>   
> 
> "java.util.HashMap"/>
> property="membername"
> value="${requestScope.membername}"/>
> property="task" value="delete"/>
> name="deleteNotesLink">delete
> 
>   forEach Loop (inside ManageNotesForm):
>   =
> 
>items="${sessionScope.messageInstances}"
> var="aMessageInstance" varStatus="status">
>property="selectedItems">
>   
>   
>   
>   
> 
> ManageNotesForm Bean:
> 
> 
> private String[] selectedItems = {};
> 
> public String[] getSelectedItems() {
> return selectedItems;
> }
> 
> public void setSelectedItems(String[]
> selectedItems) {
> this.selectedItems = selectedItems;
> }
> 
> 
> 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 





__
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

-
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]



Re: JSTL and Multibox Submit Problem

2004-05-25 Thread Richard Yee
Ricardo,
If you are going to use the html:link tag, then you
need to have it trigger a call to a JavaScript
function that will submit the form for you. Otherwise,
jjust clicking the link will not submit the form.

Regards,

Richard

--- Ricardo Cortes <[EMAIL PROTECTED]> wrote:
> Hi there,
> 
> I am having a problem getting the checked values
> from a multibox that is submitted to my action and I
> was hoping one of you could help me out.  I followed
> Ted Husted's example of using a Multibox within an
> iteration but I have a feeling that my setup is a
> bit different and thus renders a different solution.
>  I'm using a JSTL forEach loop to loop through a
> list of MessageInstance objects.  I want the user to
> be able to check which MessageInstances should be
> deleted and the action to perform the deletion. 
> Everything gets rendered ok but when the form is
> submitted, the String[] object in the form is empty.
>  I should also note that everything works fine if I
> use an html:submit but when I try to use an
> html:link to do the submit I don't get any checked
> values in my String[] object.  I've included some
> code snippets below.  Any help would be awesome.
> 
> Thanks!
> Ricardo
> 
> JSP:
> ===
> 
>   Submit Link (inside ManageNotesForm):
>   
> 
> "java.util.HashMap"/>
> property="membername"
> value="${requestScope.membername}"/>
> property="task" value="delete"/>
> name="deleteNotesLink">delete
> 
>   forEach Loop (inside ManageNotesForm):
>   =
> 
>items="${sessionScope.messageInstances}"
> var="aMessageInstance" varStatus="status">
>property="selectedItems">
>   
>   
>   
>   
> 
> ManageNotesForm Bean:
> 
> 
> private String[] selectedItems = {};
> 
> public String[] getSelectedItems() {
> return selectedItems;
> }
> 
> public void setSelectedItems(String[]
> selectedItems) {
> this.selectedItems = selectedItems;
> }
> 
> 
> 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 





__
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

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



JSTL and Multibox Submit Problem

2004-05-25 Thread Ricardo Cortes
Hi there,

I am having a problem getting the checked values from a multibox that is submitted to 
my action and I was hoping one of you could help me out.  I followed Ted Husted's 
example of using a Multibox within an iteration but I have a feeling that my setup is 
a bit different and thus renders a different solution.  I'm using a JSTL forEach loop 
to loop through a list of MessageInstance objects.  I want the user to be able to 
check which MessageInstances should be deleted and the action to perform the deletion. 
 Everything gets rendered ok but when the form is submitted, the String[] object in 
the form is empty.  I should also note that everything works fine if I use an 
html:submit but when I try to use an html:link to do the submit I don't get any 
checked values in my String[] object.  I've included some code snippets below.  Any 
help would be awesome.

Thanks!
Ricardo

JSP:
===

  Submit Link (inside ManageNotesForm):
  

   
   
   
   delete

  forEach Loop (inside ManageNotesForm):
  =

  




  

ManageNotesForm Bean:


private String[] selectedItems = {};

public String[] getSelectedItems() {
return selectedItems;
}

public void setSelectedItems(String[] selectedItems) {
this.selectedItems = selectedItems;
}





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



Multipage form and multibox fields

2004-05-19 Thread Diego


Hi everyone! I have a multi-page form with several multibox fields in its
different pages. The form is stored in session. In the ActionForm Javadoc I
found this:

--If the form is stored in session-scope so that values can be collected over
--multiple requests (a "wizard"), you must be very careful of which properties,
if
--any, are reset. As mentioned, session-scope checkboxes must be reset to false
--for any page where this property is set. This is because the client does not
--submit a checkbox value when it is clear (false). If a session-scoped
checkbox
--is not proactively reset, it can never be set to false.

Well, the problem I have is that I don't know how to do that. I mean, I know
where the reset() method is and I know how to set the multibox to false, but is
there a way to know what is the page number the user is going to? I just need to
reset the multibox fields that are on that page, if I've understood the text
above. The "page" field doesn't give me the page number I'm moving to, but the
previous one, I think.

Thanks in advance.


This message was sent using IMP, the Internet Messaging Program.


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



  1   2   >