cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to pass parameters for the action in the confirmation dialog

Former Member
0 Kudos

I tried it but a null pointer exception is occuring. Is it possible to pass parameters ,if s give the solution....

Thanks and regards.

Karthik.

Accepted Solutions (1)

Accepted Solutions (1)

former_member751941
Active Contributor
0 Kudos

Hi Karthi,

Directly it is not possible. You can achieve it by this way.

1> Create 2 Event Handlers say “OK” and “OKTest”.

public void OK(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin OK(ServerEvent)

String param = "abc";

wdThis.OKTest(wdEvent,param);

//@@end

}

public void OKTest(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String paramtest )

{

//@@begin OKTest(ServerEvent)

wdComponentAPI.getMessageManager().reportSuccess("Param : "+paramtest);

//@@end

}

2> Code for popup.

String dialog = "No of Rows : ";

IWDConfirmationDialog confDialog = wdComponentAPI.getWindowManager().createConfirmationWindow(dialog,wdThis.wdGetAPI().getViewInfo().getViewController().findInEventHandlers("OK"),"OK");

confDialog.setTitle("Test Window");

confDialog.show();

/thread/66776 [original link is broken]

Regards,

Mithu

Former Member
0 Kudos

Hi mithu,

I am using back end data. Using custom controller i am receving the data from the back end. How to pass this data to the event in confirmation dialogbox.

I aslo tried ur method for this as

com.sap..... parameter;

it is showing error

thanks and regards,

karthik.

former_member751941
Active Contributor
0 Kudos

Hi Karthi,

You are taking the param of type "com.sap......Parameter"

that’s why it is giving error. what error r u getting?

public void OkTest(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String paramtest )

i have taken the <b>paramtest</b> of type <b>String</b>.Check the signature of event handler. It will definitely work.

Regards,

Mithu

Former Member
0 Kudos

Hi mithu,

public void OkTest(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.sap.IPrivateTestView.IListElement paramtest)

{

pass to customcontroller method

}

This is the parameter i am using,but i am getting error in the ok() method as(The local variable node element may not be initialized) not intialized. How to initialize this parameter..

void ok()

{

com.sap.IPrivateTestView.IListElement paramtest;

wdthis.okTest(wdEvent,paramtest);

}

Former Member
0 Kudos

Hi Karthi,

void ok()

{

<b>com.sap.IPrivateTestView.IListElement paramtest = wdContext.nodeList().createListElement();</b>wdthis.okTest(wdEvent,paramtest);

}

Warm Regards,

Murtuza

former_member751941
Active Contributor
0 Kudos

Hi karthi,

For 0..n node use .

IPrivateTestView.IListElement paramtest = wdContext.createListElement();

Paramtest.setAttrr(Value);

wdContext.nodeList().addElement(Paramtest);

Other wise you can change the node cardinality 1..n

Regards,

Mithu

Former Member
0 Kudos

Hi mithu,

Thank u very much for ur guidence. I solved it.

Regards,

karthik.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

How will you use the paramaters? Just curious to know.

Are you talking about passing the parameter for the Eventhandler of the Confirmation Dialog?

-np