cancel
Showing results for 
Search instead for 
Did you mean: 

How to refresh a selected checkbox in BSP?

Former Member
0 Kudos

Hello All,

I have a BSP application in which the user is able to select multiple checkboxes coming under a particular product. These checkboxes points towards the database table and display values for that particular checkbox in the next page. (The checkboxes refers to areas coming under a particular product.)

This is working fine, but when I tried to deselect a checkbox, itu2019s not getting deselected i.e.; once the checkbox is selected, I am unable to uncheck it.

I should be able to select or deselect the required checkboxes.

Could anybody guide me in this?

Thanks in Advance,

Shino

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

To deselect checkbox, after selecting checkbox and displaying data for selected checkbox, Clear the checkbox .

Hope this helps you

Regards,

Rajani

Former Member
0 Kudos

Hi All,

I have created checkbox in a similiar way as you mentioned.

The problem is that once i have checked an area checkbox, i am unable to deselect the checked checkbox. I have tried to remove the


checked  = " <%= wa-checked %>"

from the layout page, then in the first web page,i am able to deselect a checked checkbox, but when i am navigating to the next page, it is giving value for the deselected checkbox area also.

I hope you are clear with my problem now.

Could anyone help me?

Thanks In advance,

Shino

sagarmehta
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Shino,

Could you share your logic for selecting and unselecting...

Regards,

Sagar

Former Member
0 Kudos

Hello Sagar,

This is my logic for selecting and unselecting the checkbox, which is in my event handler,On request.

ELSEIF event->name = 'checkbox'
    AND event->id CS 'AreaCheckbox'
    AND event->event_type = 'click'.
    checkboxselect ?= event.
    wa = checkboxselect->key.
    LOOP AT itab_areainfo INTO area_wa.
      IF area_wa-area = wa.
       area_wa-checked = 'X'.
        MODIFY itab_areainfo INDEX sy-tabix
            FROM area_wa TRANSPORTING checked.
      ENDIF.
    ENDLOOP.

I think there is some mistake in this logic, but i am unable to find it out.

Could anyone help me with a solution?

Thanks In Advance,

Shino

Edited by: Shino Kuruvilla on Mar 9, 2009 11:56 AM

sagarmehta
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Shino,

Well looking at the code, you are maintaining an internal table which contains the checkbox status's.

All you need to do is toggle between the checkbox status's.

I mean:-

LOOP AT itab_areainfo INTO area_wa.
      IF area_wa-area = wa.

       	IF area_wa-checked = ''.
	  area_wa-checked = 'X'.
	ELSE.
	  area_wa-checked = ''.
	ENDIF.
       
	MODIFY itab_areainfo INDEX sy-tabix
            FROM area_wa TRANSPORTING checked.
      ENDIF.
ENDLOOP.

I hope this solves your issue.

Thanks and Regards,

Sagar.

Edited by: Sagar Mehta on Mar 9, 2009 12:01 PM

Former Member
0 Kudos

Hi Shino,

I think you have missed out some of the properties:

1. Checked

3. onClick

2. onClientClick

Try changing the value of checked to false on onClientClick.

It is long before I have worked on BSPs, sorry if this didn't work.

I think handling the property 'checked' in onClick event will work.

Will be happy if you let me know the result

Regards,

Nrisimhanadh

Hey,

I think Sagar's reply should work....

Regards,

Nrisimhanadh

Edited by: Nrisimhanadh Yandamuri on Mar 9, 2009 12:10 PM

Former Member
0 Kudos

Hello Sagar,

That was a perfect sloution. Thanks alot for your reply.

As I told before, that was a problem with the logic.

When i tried your logic with toggling,my problem is resolved.

Cheers,

Shino

@Nrisimhanadh: Thank you for your time also. As you told, Sagar's logic helped me perfectly fine.

Answers (2)

Answers (2)

Former Member
0 Kudos

Dear Shino,

I think, the value of the checkbox doesn't get refreshed. You did a particular action if that checkbox is selected. Like that you can check if the element is deselected then, clear that value.

Appreciated if its Helpful.

Regards,

Anita Vizhi Arasi B

Former Member
0 Kudos

Hi Friend,

Kindly let us how your check box was designed?

Normally using htmlb, codings for designing a checkbox is as follows:

     <htmlb:checkbox key      = "cb1"
                  id      = "cb2"
                 tooltip  = "As per your wish"
               disabled   = "false"
               encode     = "false" > 

Please let us have a detailed description about your problem.

With Regards,

SHARMILA BRINDHA.M