on 11-07-2008 10:03 AM
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
Hi
Replace :
IWDAttributeInfo a2=wdContext.getNodeInfo().getAttribute(IPublicUIEelementComp.IMyDataElement.GENDER);
with:
IWDAttributeInfo a2=wdContext.nodeMyData().getNodeInfo().getAttribute(IPublicUIEelementComp.IMyDataElement.GENDER);
Regards,
Apurva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
Armin
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.