cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding CheckBox's in a Table.......

Former Member
0 Kudos

Hi,

In my Application the requirement is such that i need to select Multiple rows in a table without using Ctrl key of the keyboard .

But i am unable to directly select these rows through Click of a Mouse.

Is it possible to select these multiple rows on Click.

Please help me out in this regard.

Thanks and regards,

Chandrashekar.

Accepted Solutions (1)

Accepted Solutions (1)

former_member197348
Active Contributor
0 Kudos

Hi Chandra,

Create a <b>value node</b> in your parent node (i.e. node bound to table) with properties singleton false cardinality 1..1. Create a context attribute of type boolean in the <b>value node</b>. Bind this attribute to your tableCell CheckBox. You can check multiple Check boxes by setting the attribute to <b>true</b>.

wdContext.node<parent>.get<parent>ElementAt(i).current<valuenode>Element.set<attribute>(true);

regards,

Siva

Former Member
0 Kudos

Hi Siva,

Programatically i dont want to set the chkbox to true..I want to capture all the chkboxes which are selected by the user at runtime and delete those records from R/3 system

As u mentioned i created a value node in the node that is already binded with the table and mapped the value attribute to the newly created Colum of the table..

On click of Execute i have to get all the records means multi records selected by the user at runtime

Regards

Chandrashekar.

former_member197348
Active Contributor
0 Kudos

Hi Chandra,

If you want to delete the selected records, do this:

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

{

//check for selected element

if(wdContext.node<parent>.get<parent>ElementAt(i).node<valuenode>.current<valuenode>Element.get<attribute>();)

{

// set the attributes to your input modelnode (Hope you know how to set, if not just post your //Node and its structure)

}

}

//RFC call

regards,

Siva

Former Member
0 Kudos

Hi Siva,

I added one column as chkbox..but that chkbox is not getting selected at runtime and after chkbox false is getting displayed.

Regards

chandrashekar.

former_member197348
Active Contributor
0 Kudos

Hi Chandra,

Please assure in the context tab the properties of the <u>valuenode</u>.

<b>cardinality 1..1

selection 0..1

singleton false</b>

In the layout tab, table properties

<b>compatibilityMode nw04Plus

selectionMode none

</b>

Check th properties of Check box also.

No need of onToggle event

I have been working this type of deletion for one year so many times successfully.

regards,

Siva

Former Member
0 Kudos

Hi Siva,

I understand from several replies it is very important to mention

"cardinality", "selection" values properly as per bussiness requirments.

Could you please provide me detail information in understanding the selection of

"cardinality"

"selection"

former_member197348
Active Contributor
0 Kudos

Hi Raghu,

In Simple terms, <b>cardinality</b> refers minimum..maximum (0..n) elements that a node can contain.

<b>selection</b> refers to value(0..1) of that node requires.

regards,

Siva

Former Member
0 Kudos

>>selection refers to value(0..1) of that node requires

You mean the value of each element is from minimum of zero to maximum of one.

Could provide more information on selection.

I need your reply in brief becuase i am stopped at these places every time due to some error (java.lang.NullPointerException)....

former_member197348
Active Contributor
0 Kudos

Hi Chandra,

Did you get any success for your problem? If yes, please close this thread by rewarding points to helpful answers.

Raghu,

Selection 0..1 means an attribute can have either 0 value or 1 value at a time.

regards,

Siva

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Chandrashekar,

Check this thread & reply from armin. Its always suggested to use the table as its designed.

regards

Sumit

former_member751941
Active Contributor
0 Kudos

Hi chandrashekar ,

yes it is possible.

Select the ValueNode [cardinality 0..n] that is bound to your table

and change the <b>selection</b> property value to <b>0..n</b>.

In view layout select the table and change

<b>selectionMode </b> property value to <b> auto </b>

Regards,

Mithu

Former Member
0 Kudos

Hi,

Take one value attribute of type boolean as child of <TableNode>,say selected

Insert another column in the table.. then right click on <column>> insertTableCellEditor> then insert checkbox.

bind the checked property of checkbox to the value attribute created above

In onToggle action of checkbox create an action, say ChkSelect

In ChkSelect write following code

Then use this code to check for each row selecetd or not..

int count=0;

for(int i=0;i<wdContext.node<TableNode>.size();i++)

{

if(wdConetxt.node<TableNode>().get<TableNode>ElementAt(i).getSelected==true)

{

count++;

//Perform required operation

}

}

wdComponentAPI.getMessageManager.reportSuccess(" "count"rows selected");

Regards

LakshmiNarayana