Skip to Content
avatar image
Former Member

Accessing UIelements under group(UIElement)

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 ..

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    Aug 12, 2005 at 06:20 AM

    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>()

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 12, 2005 at 06:23 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • avatar image
    Former Member
    Aug 12, 2005 at 06:36 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 12, 2005 at 06:42 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 12, 2005 at 06:49 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 12, 2005 at 07:15 AM

    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-0010-429c-d1c522d8a32a

    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

    Add comment
    10|10000 characters needed characters exceeded