cancel
Showing results for 
Search instead for 
Did you mean: 

table with checkbox

Former Member
0 Kudos

Hi Experts,

I have one table and 4 column. i need

1. one check box for selection

2. if i click the check box entire row will be selected.

how to give checkbox?

its very urgent?

Regards,

P.Manivannan.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

chk it

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Manivannan,

Is your scenario like this?

You have a table with 4 columns

Near to the table , you need a checkbox, for selecting entire rows of the table

In your View Context add 1 value attribute, say 'checkVar' of type boolean.

Then in your view layout insert a check box.

Then go to the properties of checkbox.

select the property 'checked' , bind it to your boolean attribute 'checkVar'.

Then in checkbox's properties itself , select the event 'onToggle'.

create an action for this.

In that action write the coding

{

boolean chk=wdContext.currentContextElement().getCheckVar();

if(chk)

{

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

{

wdContext.node<youtTableValueNode>().setSelected(i,true);

}

}

else

{

wdContext.node<youtTableValueNode>().clearSelection();

}

}

Also note : set the table's property 'selection mode' to 'multi'

Former Member
0 Kudos

Hi Experts,

Thanks for ur replies. I got the table with check box. I choose node cardinality is 1.n and selection is 0.n this is correct..and one more thing.

1. How to pass the selected values into another table. the new table placed into the new page.(i had stored Static values in the first table like Sting s[]{'a','b',})

how to do that? please help

Regards,

P.Manivannan.

Former Member
0 Kudos

closed

Former Member
0 Kudos

Hi P.Manivanna,

Add a new attribute typed boolean in your node and put this attribute in your table. Right click at table -> insert column -> right click at new column -> insert TableCellEditor -> select CheckBox and press finish, go to properties of this checkbox and change de properties checked here you put the attribute created above typed boolean.

Regards,

Edson Thomaz

Former Member
0 Kudos

Hi..

1. Create a table.

2. Bind it with the context elements.

3. Create an attribute with type boolean.

4. Create a check box and bind it with tht boolean variable.

5. Create a button. Here i am writing anexample coding ...

for(int j=0;j<wdContext.nodePassword().size();j++)

{

if(wdContext.nodePassword().getPasswordElementAt(j).getChk())

{

wdComponentAPI.getMessageManager().reportSuccess(wdContext.nodePassword().getPasswordElementAt(j).getName());

wdComponentAPI.getMessageManager().reportSuccess(wdContext.nodePassword().getPasswordElementAt(j).getNo());

}

}

Hop it helps..

GS