cancel
Showing results for 
Search instead for 
Did you mean: 

Radio Button..............

Former Member
0 Kudos

Hi,

How to go to different Views when we select a particular Radio button..?(i.e if there r 2 buttons by selecting first it should go to first view, by selecting 2nd go to 2nd).........?

How to assign different themes to the Radio buttons?

Plz send reply...

Accepted Solutions (0)

Answers (1)

Answers (1)

saraswathi_d
Participant
0 Kudos

Hi,

This is the code for creating radio button.

First create a simple type in Dictionary. In the webDynpro structure go to [Dictionary -> Local Dictionary -> data Types -> Simple Types].

Create a simple type, with Enumeration from Enumeration tab values like 1,2,3,4,5 as per your requirement.

Now in create a attribute in context node (Say: Selection)and assign the type from the Simple Type. Select the package which you may have entered while creating the simple type and then finally bind this simple type with this attribute.

Now create a UI element [RadioBUttonGroupByKey], in the SelectedKey property of this UI element bind the attribute which you have now created.

Create a Action for this dropdown UI element. In this action you can write this code:

String selection = wdThis.wdGetContext().currentContextElement().getSelection();

if(selection.equalsIgnoreCase("1")){

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("Button 1 is selected");

}

else if(selection.equalsIgnoreCase("2")){

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("Button 2 is selected");

}

..

..

..

else if(selection.equalsIgnoreCase("5")){

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("Button 5 is selected");

}

Create a view set in diagram view. There embed two views. Make the second view default property as false. create two actions. In onselect radio button method write the implementation. Use the below code

wdThis.wdFirePlugToFirtstView(parameters);

Regards,

Saraswathi.

Pls reward points for useful information