cancel
Showing results for 
Search instead for 
Did you mean: 

I want to use simple CheckBox

Former Member
0 Kudos

Hi, I want to use simple checkbox in webdynpro. and if user check that checkox, i want to pass that value to R/3. But i'm facing problem to simply display that checkbox while running it. During design time it is getting displayed, but when i'l run the application, checkbox label will not get displayed. so pls help me out...

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Ali,

I will give u more precise answer to ur question.

Do the following..

1. Create a node(Say "CheckBox" ) with following properties.

<b> Cardinality : 0..n

Initialized Lead selection : false

Selection : 0..n</b>

2. Create an attributes( Say " text " of type String ) under the node " CheckBox "

3. Insert a <b>CheckBoxGroup</b> in ur layout and assign the texts property to the context variable " text "

4. Get the texts from R/3 and assign those values to this " text " variable as follows

IPrivate<Viewname>.ICheckBoxNode cNode=wdContext.nodeCheckBox();

for(int i=0;i<wdContext.node<R/3 node>.size();i++)

{

IPrivate<Viewname>.ICheckBoxElement cEl=cNode.createElement();

cNode.addElement(cEl);

cEl.setText( wdContext.node<R/3 node>.get<R/3 node>ElementAt(i).get<R/3 text attribute>() );

}

5. Inside the action in which u want to get the check box state, add the following code. It will display the label of the checkbox u had selected.

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

{

if(wdContext.nodeCheckBox().isSelected(i))

{

wdComponentAPI.getMessageManager().reportWarning("Text which is checked is "+wdContext.nodeCheckBox().getCheckBoxElementAt(i).getText());

}

}

Regards

Fahad Hamsa

Former Member
0 Kudos

Hi Fahad,

Thanks for your detail code, i really appreciate your help regarding the mentioned issue. I've implemented in the same way in which you have mentioned in your posted code. Thanks for your reply. It really helped me a lot. Also the mail coding which i requested you, really helped me a lot. Thanks for your instant help.

Regards,

Ali

Former Member
0 Kudos

Hi Ali,

Ensure the visibility of check box as visible.

If u r using Checkbox, create a boolean type variable in ur context and bind it to the checkbox. Give a text to the ' text ' property of checkbox.

If u r using Checkbox group, this will not work. So also ensure that u r not using Checkbox Group.

Regards

Fahad Hamsa

abhijeet_mukkawar
Active Contributor
0 Kudos

hi,

Attach some context attribute to checkbox. Declare this as a boolean since checkbox takes boolean value.

The value of checkbox is then read by reading the value of this context attribute.

regards,

abhijeet

former_member186016
Active Contributor
0 Kudos

Hi Ali,

Have you initilized the text for checkbox, if you have binded the checkbox's text to some context element ?

Try simply giving some text to checkbox element.

Regards,

Ashwani