cancel
Showing results for 
Search instead for 
Did you mean: 

Checkboxes remain set when looping over screen

0 Kudos

Hi there,

I have got a problem with some checkboxes on a BSP with MVC.

I am creating an extension for cProjects within a single tabStrip.

My BSP constist of several checkboxes and I want to loop over this screen for some times to collect data. For every call of the BSP I create a new instance, set page attributes and call the view in DO_REQUEST. The page attributes cause some checkboxes to be set. This works fine so far.

My problem is that checkboxes that were selected on the previous screen remain selected.

I think this happens because the checkboxes have the same names as those on previous screens.

How can I disable this behaviour? I would appreciate your help.

View Entire Topic
raja_thangamani
Active Contributor
0 Kudos

Welcome to SDN..

Make your BSP application as <b>"Stateless"</b> mode. If its already in stateless mode, pls post your with comments..

<i>* Reward each useful answer</i>

Raja T

Message was edited by:

Raja Thangamani

0 Kudos

Hi Raja,

thanks for your friendly welcome!

My BSP is already stateless. It is for assigning test

types to components in a production project and for

assigning standards to these test types. So there are

some nested groups with checkboxes.

First I loop over some existing test types and standards which will be displayed as 'checked' and the checkboxes are disabled. This works great so far.

<%@page language="abap" %>

<%@extension name="bsp" prefix="bsp" %>

<%@extension name="htmlb" prefix="htmlb" %>

<%@extension name="xhtmlb" prefix="xhtmlb" %>

<%@extension name="phtmlb" prefix="phtmlb" %>

<xhtmlb:overflowContainer>

<htmlb:button id = "test_comp_next"

text = "Next"

tooltip = "Go to next step in Task Wizard"

onClick = "test_comp_next"

design = "EMPHASIZED" />

<br />

<htmlb:textView text = "Component Validation"

design = "EMPHASIZED" />

<br />

<htmlb:group>

<htmlb:groupHeader>

<htmlb:textView text = "<%= ms_component-task_descr %>"

design = "EMPHASIZED" />

</htmlb:groupHeader>

<htmlb:groupBody>

<table cellpadding="5" valign="TOP" >

<tr>

<%

mv_counter = 0.

loop at mt_test_types_available into ms_test_type_available.

read table mt_test_types into ms_test_type with key task_type = ms_test_type_available-test_type.

if ms_test_type is not initial.

mv_counter = mv_counter + 1.

%>

<td valign="TOP">

<htmlb:group width="110px" >

<htmlb:groupHeader>

<htmlb:textView text = "<%= ms_test_type-task_type %>"

design = "EMPHASIZED" />

</htmlb:groupHeader>

<htmlb:groupBody>

<%

loop at mt_standards_available into ms_standard_available.

if ms_standard_available-test_type = ms_test_type-task_type and ms_component-task_type = ms_standard_available-task_type.

read table mt_standards into ms_standard with key task_type = ms_standard_available-product_std parent_guid = ms_test_type-task_guid.

if ms_standard is not initial.

%>

<htmlb:checkbox id = "<%= ms_standard-task_type %><%= mv_counter %>"

text = "<%= ms_standard-task_type %>"

checked = "TRUE"

disabled = "TRUE" />

<br />

<%

clear ms_standard.

...

After displaying the already existing standards I also display other standards that are available for a component and might be selected.

...

else.

%>

<htmlb:checkbox id = "<%= ms_standard_available-product_std %><%= mv_counter %>"

text = "<%= ms_standard_available-product_std %>"

key = "<%= ms_test_type-task_type %>" />

<br />

<%

endif.

endif.

endloop.

%>

</td>

</htmlb:groupBody>

</htmlb:group>

<%

else.

...

After that I also loop over test types that are not existing yet. They and their corresponding standards can be selected in addition.

...

mv_counter = mv_counter + 1.

%>

<td valign="TOP">

<htmlb:group width="110px" >

<htmlb:groupHeader>

<htmlb:textView text = "<%= ms_test_type_available-test_type %>"

design = "EMPHASIZED" />

</htmlb:groupHeader>

<htmlb:groupBody>

<%

loop at mt_standards_available into ms_standard_available.

if ms_standard_available-test_type = ms_test_type_available-test_type and ms_component-task_type = ms_standard_available-task_type.

%>

<htmlb:checkbox id = "<%= ms_standard_available-product_std %><%= mv_counter %>"

text = "<%= ms_standard_available-product_std %>"

key = "<%= ms_test_type_available-test_type %>" />

<br />

<%

endif.

endloop.

%>

</td>

</htmlb:groupBody>

</htmlb:group>

</td>

<%

endif.

endloop.

%>

</tr>

</table>

</htmlb:groupBody>

</htmlb:group>

</xhtmlb:overflowContainer>

Message was edited by:

Stefan Grosskinsky

Message was edited by:

Stefan Grosskinsky

Message was edited by:

Stefan Grosskinsky

Sorry I have got some problems with formatting my code.

Message was edited by:

Stefan Grosskinsky

Message was edited by:

Stefan Grosskinsky

0 Kudos

Sorry, I have some problems with formatting my code. No breaks in my post are displayed when I save it.

I think I got the answer myself. While thinking about what yous said and about my own coding I got the idea to simply set the checkboxes to 'checked="FALSE"' which works creat.

Many thanks.

Message was edited by:

Stefan Grosskinsky