cancel
Showing results for 
Search instead for 
Did you mean: 

Drop-Down List in interactiveForm

Former Member
0 Kudos

Hello everybody

I've just started using interactiveForm and I've a little doubt, I've a drop-down list linked to a node of the context.

I would like to bind an action on the selection of the drop-down list that must update another field/context element.

I explain better:

I ve a list of values/points

A 2

B 1

C 3

etc..

in my list I must have A/B/C

I've a field "points"

When I select A , point must be updated to "2"

When I select B , point must be updated to "1"

Is it possible? how? I'm looking on documentation but I'm not able to find the binding with an action.

Thank you,

Serena

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor
0 Kudos

if my memory is right, there are only two action you can bind.

1. update

2. submit

your dropdown can tigger update action and set a parameter to tell your web dynpro which one is triggering the update.

in your web dynpro action handler, you can write some "if else" code to handle the update accordingly.

Former Member
0 Kudos

Sorry for my late answer but I had an urgent issue and didn't had the time to try this.

Thanks for the anwer, it's exactly what I would like to do. Except that I can't understand how to bind the update action with an event.

My interactive form is embedded in a view, if I make a new event handler in the view I'm not able to bind it with an action from the pdf.

How can I make an event handler that listen to the update event of the drop down?

junwu
Active Contributor
0 Kudos

only two action can be bind to your form.

you have to reuse one of them, usually reuse the onCheck one.

you put a hidden variable in your form, when you trigger a server round, you have to set a value to the variable.

then in the onCheck event, you can do action accordingly based on the variable.

Former Member
0 Kudos

I've used th onCheck action, I just try to display a screen message in it

//@@begin javadoc:onActioncheckType(ServerEvent)

/** Declared validating event handler. */

//@@end

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

{

//@@begin onActioncheckType(ServerEvent)

wdComponentAPI.getMessageManager().reportSuccess("test check");

//@@end

}

but when I change the value in my drop down list, I don't have my message so it doesn't pass there.

I tryed to bind also the onSumbit on this event handler but it doesn't work either

junwu
Active Contributor
0 Kudos

did you read my reply?

Former Member
0 Kudos

yes, but I wasn't able to pass throught the onCheck.

I try to explain better.

I've the drop down list, with some values.

I've bind the onCheck of my form with an action so in the property of the form I've:

EVENT

property: onCheck value: checkType

and in my code the method

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

that just print a screen message.

Now when I change the value in my dropDown, I don't have the message so I think I miss a point: how to tell the dropdown to call the onCheck when I change the value.

junwu
Active Contributor
0 Kudos

i see,

the dropdown doesn't trigger the server roundtrip. you have to user check button or write javascript to trigger.

put a check button in the form.

or

copy the script generated by check button to the "Change" event of your dropdown

this generated code in my environment(LCD 9.0.1), yours may be different

ContainerFoundation_JS.SendMessageToContainer(event.target, "check", "", "", "", "");

Former Member
0 Kudos

it works great! thank you very much

Answers (0)