Skip to Content
avatar image
Former Member

Control if checkbox is checked

Hello !

I've inserted a chekbox in a jsp page and, in my process, I want to control if this checkbox is checked or not.

In my process, I wrote :

boolean A2 = ((Checkbox) getComponentByName("A2")).isChecked();

where "A2" is id of my checkbox

...but this line generate an null error.

Could you help me please ?

Thank you.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Nov 09, 2005 at 02:07 PM

    Hi,

    boolean A2 = ((Checkbox) getComponentByName("A2")).isChecked();

    In the above code A2 should be the value of "key" field of the checkbox not the id.

    Thanks,

    Hari

    Add comment
    10|10000 characters needed characters exceeded