cancel
Showing results for 
Search instead for 
Did you mean: 

How to make Radio Button?

Former Member
0 Kudos

hi

I want to make Radio button and the values in the Radio button is accepted dynamically and that value is inserted into R/3.

How to implement it?

Regards

Nidhideep

Accepted Solutions (1)

Accepted Solutions (1)

Abhinav_Sharma
Contributor
0 Kudos

Hi Nidhideep,

we can divide dynpro project,logically, in three parts:

1.. Webdynpro : where u create ur application and component

2.. Dictionary: where u create simple types(ur case string based DDIC type)

3.. Src packagse: where u find ur packages

Follow these steps for creating simple type:

a ... Open 'Local Dictionary' -> Data Types -> Simple Type

b ... Create simple type by right click on Simple Type

c ... Select enumeration tab there and put the value and description...

and then save it .. and hey,, bingo... u've created DDIC Type

Hope it helps.

Abhinav

Former Member
0 Kudos

hi

Anubahv ,I know hw to create DDIC type ,but how to create

Set of ddic type as Armin is saying

T1 = { "buy","sell"};

is he saying to create DDIC type of type buy and sell with Same key T1?

Please help

Regards

Nidhideep

Former Member
0 Kudos

I thought it would be clear what I mean with notation

T1 = { "buy", "sell" }

It means: Create a DDIC simple type T1 (base type "string") and two enumeration keys "buy" and "sell". As enumeration values you can also use "buy" and "sell" as these are displayed in drop-down lists etc.

Armin

Former Member
0 Kudos

hi

Every one I have solved my problem.Thanks for so much support.I have also awarded points to you people.

Regards

Nidhideep

Answers (3)

Answers (3)

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

1)Create the Radio Button Group by key.

2)Create the attribute att1

3)Since u know the values to be inserted in to the R/3

u dynamically put the values.

IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute("att1");

ISimpleTypeModifiable countryType = attributeInfo2.getModifiableSimpleType();

IModifiableSimpleValueSet valueSet = countryType.getSVServices().getModifiableSimpleValueSet();

valueSet.put("value in to r/3","value in to r/3");

4)Then the radio button will be created as much

valueSet.put(); u create.

5) Create the action and set it to the onActionSelect of ur radiobutton.

6)Write this code in ur Action

String val=wdContext.CurrentContextElement().getAtt1();

7)Try to set that val to R/3

Regards,

Vijayakhanna Raman

Former Member
0 Kudos

hi

Raman i made a value node in my context called Radio Button it has two value attributes buy and sell.i have made the selection node 0..n of attributes.I bound these attributes to my radio button.I should now code in my

wdInit()method of my view,is it so.Please help me

Regards

Nidhideep

Former Member
0 Kudos

Your question is not clear enough.

Please describe exactly the use case. Then we can tell how to use radio buttons or the different radio button groups for this scenario.

Armin

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

Can u say how many radio button u need.

And what should happen after selecting it.

Regards,

Vijayakhanna Raman

Former Member
0 Kudos

hi

I have 6 radio Button (buy ,sell), (inflow ,outflow ),(capital ,revenue)in pairs.I want only one value is selected in each pair.And each value that is selected is only send to R/3 thru rfc call.

Second condition is that whenever i choose buy in my radio button ,there is another dropdown with values(Export,import),if i select buy(radio button)the value that is to be choosen in drop down is import(automatically)or the either when i select sell.

I did this so far created a Value node Check ,which has attribute choice.cardianality is 0..n and selection is 0..n

In my wdInit()

i have done this for just two radio buttons Buy and sell:

IPrivateOrder_Entry_view1.IChoiceNode radiobutton = wdContext.nodeChoice();

IPrivateOrder_Entry_view1.ChoiceElement elementRadio;

String [] check =

{ "Buy",

"Sell",

};

for(int i=0 ;i<check.length;i++)

{

elementRadio = wdContext.nodeChoice().createChoice();

wdContext.nodeChoice().addElement(elementRadio);

elementRadio.setBuy(check<i>);

wdContext.nodeChoice().setSelected(elementRadio.index(),false);

}

Am i right ,Please guide me further.

Regards

Nidhideep

Former Member
0 Kudos

You could first create string-based DDIC types with enumerations (choose suitable names instead of T1, T2, T3), e.g.

T1 = { "buy", "sell" } 
T2 = { "inflow, "outflow" }
T3 = { "capital", "revenue" }

In your context, add attributes A1, A2, A3 of each type (use suitable names).

Create RadioButtonGroupByKey instances R1, R2, R3 (choose suitable names) with

R1.selectedKey = A1
R2.selectedKey = A2
R3.selectedKey = A3

i.e. bind the "selectedKey" properties to attributes A1,A2,A3. At runtime you will then get radio buttons for each of the enumeration values of each type.

Then you will have the selected radio button values in the context attributes A1,A2,A3.

To react on a radio button selection event, assign an action to the containing radio button group event "onSelect". In the action handler, you can change the selection for the dependent drop-down list.

Armin

Former Member
0 Kudos

hi

Armin sorry for double postings.I want to know where to create string -based DDIC types with enumeration and what to with them.

Regards

Nidhideep

Former Member
0 Kudos

Hi

Try this

Create Radiobutton Group by index And bind the value by dynamically

List radio = new ArrayList();

//Create the element of radio and bind it to the list

//for eg from db

while(rs.next()){

IPrivate<View>.I<Radio>Element ele=wdContext.create<Rdio>Element();

ele.set<Param>(rs1.getString(1));

radio.add(ele);

}

//add the list to radio node

wdContext.node<radio>().bind(radio);

you can receive the value of radio as

String radiovalue=wdContext.current<radio>Element().get<param>();

Kind Regards

Mukesh

Former Member
0 Kudos