cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing UIelements under group(UIElement)

Former Member
0 Kudos

i have to views and both have a same component context

i have few redio buttons in first view under a

UIElement <b>Group</b>.

i want to set the common context as per the name of the selected radio button. i have tried the following not worked !!

<b>wdContext.currentContextElement().setModuleName

(wdComponentAPI.getComponentInfo().findInViews("AdminView").</b>

after this i m not getting ..

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi

The selected value of the radio button has to be displayed in another view, is this your requirement?

Suppose you have two radio buttons in your first view. Create two context attributes(say r1 and r2) of type String and bind them to keyToSelect property of the buttons. Create another attribute of type String and bind it to selected Key property of both buttons. Create a similar attribute in the component controller and the next view and map them. For this, refer the following tutorial.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/979de990-0201...

Set the values of the attributes r1 and r2.

Get the value of the selected radio button in the second view.

Thanks and regards

Leena

Former Member
0 Kudos

Hi Satya,

Have you done the mapping of attributes you want to share across two views through data modeler(available in menu on right click of component controller). Please do it and then the attributes will be available in both views.

Regards,

Jaydeep

Former Member
0 Kudos

Hi satya,

what are you trying to do and what do you mean by same component context.

<b>If you want to pass the value of selected radiobutton from one view to another view,you can define the context in component controller and do the appropriate mapping. </b>

And while using radiobutton group

set the keytoselect property of the radio button in the doinit. Bind it to different attribute. And bind the selectedkey to a common attribute. So which ever radiobutton is selected its value will come in selectedkey Attribute.

you can get this as

wdcontext.currentcontextelement().get<selectedkeyattribute>()

hope this helps.

regards,

rahul.

Former Member
0 Kudos

Hi,

As i suggested you can use "Selectedkey" attribute to do this.

wdContext.currentContextElement().setText(wdContext.currentContextElement().getSelectedKey());

before this you should create contextAttrib "SelectedKey" and assign this to selectedkey attribute of radiobutton.

Regards, Anilkumar

Former Member
0 Kudos

Hi Satya,

Somehow your question is not very clear !!!

You can make use of "SelectedKey" attribute of radiobutton.This specifies the path to the context attribute that stores the currently selected key.

Regards, Anilkumar

Former Member
0 Kudos

ok i want to set the context as per the <b>text</b> attribute of the selected radio button on a button click

and display the same in next page in a <b>textview</b>

hope this is clear now

Former Member
0 Kudos

Hi,

How are using the radio buttons. What do u want to set in the common context..

If u want to get the selected radio button value,

use wdCONtext.currentContextElement().get<selected key attr>()