cancel
Showing results for 
Search instead for 
Did you mean: 

Radio button

Former Member
0 Kudos

Hi,

I am trying to put one radio button in view and i am placing this code in implimentation part of Controller component

And calling that function in View.

public void Populatevalue( )

{

//@@begin Populatevalue()

try{

IWDAttributeInfo a2=wdContext.getNodeInfo().getAttribute(IPublicUIEelementComp.IMyDataElement.GENDER);

ISimpleTypeModifiable stm1=a2.getModifiableSimpleType();

IModifiableSimpleValueSet sval=stm1.getSVServices().getModifiableSimpleValueSet();

sval.put("1","Male");

sval.put("2","Female");

msgMngr.reportSuccess("In populate value"+a2);

}

catch(Exception e){

msgMngr.reportException("In populate value"+e,false);

}

When tried to run the application it is giving this error.

The initial exception that caused the request to fail, was:

java.lang.NullPointerException

at com.sap.tutwd_ui_init.UIEelementComp.Populatevalue(UIEelementComp.java:210)

at com.sap.tutwd_ui_init.wdp.InternalUIEelementComp.Populatevalue(InternalUIEelementComp.java:185)

at com.sap.tutwd_ui_init.EditMyDataView.wdDoInit(EditMyDataView.java:97)

at com.sap.tutwd_ui_init.wdp.InternalEditMyDataView.wdDoInit(InternalEditMyDataView.java:140)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)

... 36 more

See full exception chain for details.

Regards,

H.V.Swathi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Replace :

IWDAttributeInfo a2=wdContext.getNodeInfo().getAttribute(IPublicUIEelementComp.IMyDataElement.GENDER);

with:

IWDAttributeInfo a2=wdContext.nodeMyData().getNodeInfo().getAttribute(IPublicUIEelementComp.IMyDataElement.GENDER);

Regards,

Apurva

Former Member
0 Kudos

Thanks a lot.

I have one more doubt can i use simple data type in drop down by key UIelement.

How does the checkboxgroup works..

Edited by: H.V Swathi on Nov 7, 2008 12:33 PM

Edited by: H.V Swathi on Nov 7, 2008 12:34 PM

Former Member
0 Kudos

Hi Swathi,

Yes, you can.

Rgds,

Anagha

Former Member
0 Kudos

All UI elements named *ByKey use the "DDIC type with value set" data binding model.

For example if you have a value set

{ ("S", "Small"), ("M", "Medium"), ("L", "Large") }

at a DDIC type T, and you bind the "selectedKey" property of a DropDownByIndex UI element to a context attribute A of type T, then you will get at runtime a drop-down list displaying "Small", "Medium", "Large", and by selecting an item from the list, the corresponding key will be stored in attribute A.

A CheckBoxGroup works differently, it used the *ByIndex data binding model. See

https://help.sap.com/javadocs/nwce/current/wdr/com/sap/tc/webdynpro/clientserver/uielib/standard/api...

Armin

Answers (0)