Question about multiple checkbox in a form.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about multiple checkbox in a form.

Yann Bourdeau
Hi all!

I have to do a form that contains an unspecified number of (can vary
from few to many) checkboxes. I did not find a way to do it in one
panel(form) in Stripes. Can i have some of your help/suggestion to do it?

Here is more info about it: I need to give access (read write execute
(each a checkbox)) to multiple item (which the number can be varying) in
a form. Usually there is a map between the action bean and the jsp for
the variable of the checkbox in the form but i cannot use that because
the number of items is not always the same. I don't know until runtime
how many item with 3 checkboxes needs to be displayed. How i can
implement something that do it without being very complicated?

Thanks in advance.
--
Yann Bourdeau
Software Designer
[hidden email]
Mobile: +1.514.219.4607

--


CONFIDENTIALITY: This e-mail message (including attachments, if any) is
confidential and is intended only for the addressee. Any unauthorized use
or disclosure is strictly prohibited. Disclosure of this e-mail to anyone
other than the intended addressee does not constitute waiver of privilege.
If you have received this communication in error, please notify us
immediately and delete this. Thank you for your cooperation.  This message
has not been encrypted.  Special arrangements can be made for encryption
upon request.

CONFIDENTIALITÉ:  Ce message courriel (y compris les pièces jointes, le cas
échéant) est confidentiel et destiné uniquement à la personne ou  à
l'entité à qui il est adressé. Toute utilisation ou divulgation non permise
est strictement interdite.  L'obligation de confidentialité et de secret
professionnel demeure malgré toute divulgation.  Si vous avez reçu le
présent courriel et ses annexes par erreur, veuillez nous en informer
immédiatement et le détruire.  Nous vous remercions de votre
collaboration.  Le présent message n'a pas été crypté.  Le cryptage est
possible sur demande spéciale.

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Question about multiple checkbox in a form.

Grzegorz Krugły
Hi Yann,

I would go with three lists in my action bean:

List<Boolean> readPermission;
List<Boolean> writePermission;
List<Boolean> executePermission;

They would hold the state for each column of the checkboxes separately.
Then, in your JSP you can use Stripes' feature of multiple checkboxes as
described in the documentation here
http://stripes.sourceforge.net/docs/current/taglib/stripes/checkbox.html 
- look for "The other common usage is to use checkboxes in a manner
similar to a multi-select." sentence and read on :-)

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Question about multiple checkbox in a form.

VANKEISBELCK Remi
In reply to this post by Yann Bourdeau
Hello Yann,

Seems like a use case for Indexed Properties ? 

You can do stuff like :

<c:forEach items="${actionBean.myObjects}" var="my" varStatus="st">
  ...
  <s:checkbox name="my[st.index].myBoolProp"/>
  ...
</c:forEach>

Stripes binds Lists and Maps : you can use this in order to display (and repop/bind) an arbitrary number of checkboxes...

HTH

Rémi



2013/5/23 Yann Bourdeau <[hidden email]>
Hi all!

I have to do a form that contains an unspecified number of (can vary
from few to many) checkboxes. I did not find a way to do it in one
panel(form) in Stripes. Can i have some of your help/suggestion to do it?

Here is more info about it: I need to give access (read write execute
(each a checkbox)) to multiple item (which the number can be varying) in
a form. Usually there is a map between the action bean and the jsp for
the variable of the checkbox in the form but i cannot use that because
the number of items is not always the same. I don't know until runtime
how many item with 3 checkboxes needs to be displayed. How i can
implement something that do it without being very complicated?

Thanks in advance.
--
Yann Bourdeau
Software Designer
[hidden email]
Mobile: <a href="tel:%2B1.514.219.4607" value="+15142194607">+1.514.219.4607

--


CONFIDENTIALITY: This e-mail message (including attachments, if any) is
confidential and is intended only for the addressee. Any unauthorized use
or disclosure is strictly prohibited. Disclosure of this e-mail to anyone
other than the intended addressee does not constitute waiver of privilege.
If you have received this communication in error, please notify us
immediately and delete this. Thank you for your cooperation.  This message
has not been encrypted.  Special arrangements can be made for encryption
upon request.

CONFIDENTIALITÉ:  Ce message courriel (y compris les pièces jointes, le cas
échéant) est confidentiel et destiné uniquement à la personne ou  à
l'entité à qui il est adressé. Toute utilisation ou divulgation non permise
est strictement interdite.  L'obligation de confidentialité et de secret
professionnel demeure malgré toute divulgation.  Si vous avez reçu le
présent courriel et ses annexes par erreur, veuillez nous en informer
immédiatement et le détruire.  Nous vous remercions de votre
collaboration.  Le présent message n'a pas été crypté.  Le cryptage est
possible sur demande spéciale.

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Question about multiple checkbox in a form.

Yann Bourdeau
In reply to this post by Yann Bourdeau
Thanks for the reply gshegos and Remi. I'll do a list of boolean in my
action bean and enumerate them in my jsp.

--
Yann Bourdeau
Software Designer
[hidden email]
Mobile: +1.514.219.4607

--


CONFIDENTIALITY: This e-mail message (including attachments, if any) is
confidential and is intended only for the addressee. Any unauthorized use
or disclosure is strictly prohibited. Disclosure of this e-mail to anyone
other than the intended addressee does not constitute waiver of privilege.
If you have received this communication in error, please notify us
immediately and delete this. Thank you for your cooperation.  This message
has not been encrypted.  Special arrangements can be made for encryption
upon request.

CONFIDENTIALITÉ:  Ce message courriel (y compris les pièces jointes, le cas
échéant) est confidentiel et destiné uniquement à la personne ou  à
l'entité à qui il est adressé. Toute utilisation ou divulgation non permise
est strictement interdite.  L'obligation de confidentialité et de secret
professionnel demeure malgré toute divulgation.  Si vous avez reçu le
présent courriel et ses annexes par erreur, veuillez nous en informer
immédiatement et le détruire.  Nous vous remercions de votre
collaboration.  Le présent message n'a pas été crypté.  Le cryptage est
possible sur demande spéciale.

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users