cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Retrieving data from the check box group.....

Former Member
0 Kudos

Hi all,

I am new to webdynpro Java. I'm facing a problem while retrieving data from the check box group..

I've taken a simple type "Status" and Node with value attribute named status and set the property of that attribute as the simple type. This attribute is bound to the checkboxgroup.The cardinality of the Node is 0..n

But i am unable to read the checked items of the group.

Please help me out in solving my problem........

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Uday,

Welcome to SDN,

You can get the checked check boxes using:

wdContext.node<YOUR NODE NAME>().isMultiSelected(int index) which will return true if the checkbox at index is selected. Node here is the node containing the attribute to which your checkbox is mapped.

Hope this will solve your problem.

thanks & regards,

Manoj

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

If your node Name is test the following is the code

for (int x=0; x< wdContext.nodeTest().size(); x++)

{

if( wdContext.nodeTest().isMultiSelected(x) )

//Do what you want to do here

}

Regards

Ayyapparaj

Former Member
0 Kudos

after doing that what should i do can u tell me..........

how to get the value that i have checked in runtime inorder to use that value and retrive the data from database.........

Former Member
0 Kudos

Hi Uday,

In ayyaparaj's code just add these lines

for (int x=0; x< wdContext.nodeTest().size(); x++)

{

if( wdContext.nodeTest().isMultiSelected(x) )

// for getting the values

wdContext.nodeTest.getElementAt(x).get<ur attribute value>

}

regards

Sumit

Former Member
0 Kudos

Hi,

Use the following

for (int x=0; x< wdContext.nodeTest().size(); x++)

{

if( wdContext.nodeTest().isMultiSelected(x) )

// Selected Element

IWDNodeElement nodeElement = wdContext.nodeTest().getElementAt(x);

nodeElement.setAttributeValue("<Your Attribute> ", <Value>);

//Ex setting value for attribute called Name

nodeElement.setAttributeValue("Name", "Test");

}

Regards

Ayyapparaj