Skip to Content
0
Former Member
Jun 13, 2008 at 08:19 AM

How to create radiobuttons dynamically

21 Views

Hi,

I've always used static simpletypes when I created radiobuttons dynamically, but now I'm trying to get the possible answers of a radiobutton from a RFC.

My scenario is:

I use an initial RFC which returns me a table with questions, desciptions,...and then I use a 2nd RFC with the identifier of each question and SAP returns the different possible answers the user could choose in the radiobutton. All possible answers will be strings.

Can you help me?

wdDoInit

======

....
//execute first RFC: Zhr_Bapi_Appraisal_Getdetail_Input
wdContext.currentZhr_Bapi_Appraisal_Getdetail_InputElement().setAppraisal_Id(codeBapi2);	  wdContext.currentZhr_Bapi_Appraisal_Getdetail_InputElement().setPernr(pernBapi2);
wdContext.currentZhr_Bapi_Appraisal_Getdetail_InputElement().setPlan_Version("01");
wdThis.wdGetBapiEvaluacionesCust0Controller().executeBapi_Appraisal_GetDetail();
wdThis.wdGetBapiEvaluacionesCust0Controller().executeZhr_Bapi_Appraisal_Getdetail_Input();

for (int i=0; i<IAppraisal_DataSalidaNode dataSalidaNode = wdContext.nodeOutputSalida().nodeAppraisal_DataSalida().size(); i++){

//execute second RFC:Bapi_Appraisal_Scale_Getdetail_Input
wdContext.currentBapi_Appraisal_Scale_Getdetail_InputElement().setElement_Id(element.getElement_Id());	wdContext.currentBapi_Appraisal_Scale_Getdetail_InputElement().setElement_Type(element.getElement_Type());
wdContext.currentBapi_Appraisal_Scale_Getdetail_InputElement().setPlan_Version("01");
wdThis.wdGetBapiEvaluacionesCust0Controller().executeBapi_Appraisal_Scale_Getdetail_Input();
// if the second RFC returns a anything different form null I would like to create/edit generic simpletype to create the radiobutton possible answers
if (wdContext.nodeOutputSalida2().size>0){
//which code should I use here?? I guess that something like this:
for (int j=0; j<wdContext.nodeOutputSalida2().size; j++){
IwdAttibuteInfo info=wdcontext.node<nodename>().getNodeInfo().getAttribute(<Attribute name created in the Node>);
ISimpleTypeModifiable stm=info.getModifiableSimpleType();
IModifiableSimpleValueSet svs=stm.getSVServices().getModifiableSimpleValueSet();
svs.put(""+j,wdContext.nodeOutputSalida2().getAnswerElementAt(j).getAnswerText());
}
}
}

Edited by: Joan Roda on Jun 13, 2008 10:24 AM