cancel
Showing results for 
Search instead for 
Did you mean: 

checkbox group

Former Member
0 Kudos

hai all,

iam using checkbox group and iam adding the node elements at run time.I need to get the text values of the selected checkboxes.but the first value is set for all checkboxes.how to get them individually.

Thanks n Regards

Sharanya.R

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sharanya,

If u have mapped ur checkbox value to any particular attribute in the context, set it to null at the starting... This may help u..

Regards,

Sayan Ghosh

Former Member
0 Kudos

hai sayan,

when i set as you said it gives null pointer exception.

Thanks n regards

Sharanya.R

Former Member
0 Kudos

Hi,

can you post the code how the check box is populated?

Regards

Ayyapparaj

Former Member
0 Kudos

hi ayyapparaj,

for (int i = 0; i < 4; i++)

{

IPrivateCheckdynauiView.IProtectionsElement e = wdContext.nodeProtections().createProtectionsElement();

wdContext.nodeProtections().addElement(e);

e.setText("protections" + i);

}

now the checkbox is created with text protections0..... protections3 displayed next to them.

the user may select one among the checkbox or may chose 3 or 4.I need the checkbox values that the user has selected and send those values to next view.please help me doing that.

Thanks n Regards

Sharanya.R

Former Member
0 Kudos

Hi,

Use the following code



// change the node names to that of yours
for(int x=0; x<wdContext.nodeOrders().size(); x++)
	  {
		  if ( wdContext.nodeOrders().isMultiSelected(x) )
		  {
			  
			  IWDNodeElement nodeElement = wdContext.nodeOrders().getElementAt(x);
			  // Following Line will return you the selected ones.
			  nodeElement.getAttributeValue("Your attributeName");
		  }
	  }

Regards

Ayyapparaj

Former Member
0 Kudos

Move the node "Protections" to the component controller and map it from both views. Then you can get the selected texts from any of the views by checking the multi-selection of the node:


if ( wdContext.nodeProtections().isMultiselected(i)
{
  /* check box #i is selected */
}

Armin