cancel
Showing results for 
Search instead for 
Did you mean: 

problem with checkboxes

Former Member
0 Kudos

Hi all,

I am using check box in my table. and writing the code in "ontoggle" method of the check box.

1) when I am selecting a checkbox in the 3 rd row of the table, in the next screen (where it should display in the first row ) its leaving first 2 rows empty and showing in the 3 rd row. same if i select 5 th row, its showing all 4 rows empty and showing in the 5th row. How to show rows from 1st row.... ( I am selecting multiple rows)

2) when I am selecting one row, after navigating to next screen if I go back and select another row, first displayed row is not refreshing. old values exist in the displayed table. how to refresh it.

3)If I select a check box and unselect it immediatly, still that row is displaying in the next screen. what to do if I want NOT to display if a check box selected and unselected without proceeding to next screen...

Please help me out by giving solutions to above 3 problems

regards

pradeep

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I am using the code...

 for(int i=0;i<wdContext.nodeVnTable().size();i++)
 {
 if(wdContext.nodeVnTable().getVnTableElementAt(i).getChecked())
 {
 	IPrivateSearchResult.IVnTable_1Element ele= wdContext.nodeVnTable_1().createVnTable_1Element();
 	wdContext.nodeVnTable_1().addElement(ele);
 	ele.setVaOrderNo_1(wdContext.nodeVnTable().getVnTableElementAt(i).getVaOrderNo());
 	ele.setVaNoOfInserts_1(wdContext.nodeVnTable().getVnTableElementAt(i).getVaNoOfInserts());
 	ele.setVaDate_1(wdContext.nodeVnTable().getVnTableElementAt(i).getVaDate());
 	ele.setVaGrossAmount_1(wdContext.nodeVnTable().getVnTableElementAt(i).getVaGrossAmount());
 }
 }

do I need to invalidate the node for earch loop iterates????

Former Member
0 Kudos

Hi pradeep.,.

As you asked , you need to invalidate the whole node for each loop iterates... Bcs u have to refresh all the values which has been checked in the table...

Urs GS

Former Member
0 Kudos

Hi,

invalidate your node before creating elements.

<b>wdContext.nodeVnTable_1().invalidate();</b>

for(int i=0;i<wdContext.nodeVnTable().size();i++)

{

if(wdContext.nodeVnTable().getVnTableElementAt(i).getChecked())

{

IPrivateSearchResult.IVnTable_1Element ele= wdContext.nodeVnTable_1().createVnTable_1Element();

wdContext.nodeVnTable_1().addElement(ele);

ele.setVaOrderNo_1(wdContext.nodeVnTable().getVnTableElementAt(i).getVaOrderNo());

ele.setVaNoOfInserts_1(wdContext.nodeVnTable().getVnTableElementAt(i).getVaNoOfInserts());

ele.setVaDate_1(wdContext.nodeVnTable().getVnTableElementAt(i).getVaDate());

ele.setVaGrossAmount_1(wdContext.nodeVnTable().getVnTableElementAt(i).getVaGrossAmount());

}

}

Answers (2)

Answers (2)

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Pradeep,

what do you really want to achieve? Do you want to simulate multiselection in a Web Dynpro table UI element? Do you have one table column with checkboxes as cell editors to "emulate" multiselection? Which interaction behavior do you apply? You know, that you can get a reference to the clicked node element (with a boolean attribute, to which the checkbox is bound) in your action event handler without changing the lead selection (applying parameter mapping, see my SDN tutorial <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/web%20dynpro%20sample%20applications%20and%20tutorials.htm#46">Enhancing Table Performance</a>).

Multiselection simply works with CTRL+Click on the table selection column. In an actionevent handler you can then iterate the the node element list to extract the multi-selected node elements.

Regards, Bertram

Former Member
0 Kudos

Hi pradeep..

1.Sample Code:

u have to create checkbox attribute and have to bind.

Write the following code in ontoggle();

Check_Flag = wdContext.nodeFlight_List().getLeadSelection();

--> the above code is to get the id of the selected row in the table.

2.Afte u select the appropriate check boxes, then u can refresh the check boxes

by using invalidate function..

Write this funtion in Init();

3. In your third question, i cant get u clearly...need some more details...

Urs GS

Former Member
0 Kudos

The 3rd doubt was...... Generally When user selects one check box and before going to next screen and check the result page,if he unselect the selected check box, that row should not be displayed in the resultant page. but I could see the unselected row in the resultant table.

And could not get your solution to my first doubt.... it was

when I am selecting some "x" row in the main view and navigates to the result page where result table is leaving all "x-1" rows empty and showing the selected row in "x"th row. actually it should display in 1st row of the resultant row.

thanks and regards

Pradeep

Former Member
0 Kudos

It seems your lead selection value is working here for the entire table. You are trying to pass the check box values along with lead selection... So tht the unselected values get displayed...

Former Member
0 Kudos

Everything is fine now.... but just one small small problem......

In the main table, I am getting one check box extra after last row..... and in the result table (result view) I am getting one empty row (with checkbox) in the first row.... results are starting from second row. what would be the problem. I need to change any table property???

Former Member
0 Kudos

Hi..

For displaying the values in first row.. you must set the cardinality value as 1..n and selection as 0..1...

Urs GS

Former Member
0 Kudos

I already provided the same values . but it was coming like that only.

Former Member
0 Kudos

Hi pradeep

Try cardinality value as 0..n and selection as 0..1

Urs GS

Former Member
0 Kudos

Hi pradeep..

Once i also have faced the same problem.. After changing the cardinality value,(may be 0..n, 0..n or 0..n , 0..1)

i got correct output.. So its better u change thos values and try it out..

Urs GS