cancel
Showing results for 
Search instead for 
Did you mean: 

Populating drop down based upon an input field value

Former Member
0 Kudos

Hi All,

I have a code requirement where in i need to populate a drop down from a R/3 table.The drop down values are based on value in an input field,i.e based on the value entered in the input field accordingly the drop down should fill in by fetching data brom R/3.

Any Pointers??

Regards

Radhika Kuthiala

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Radhika,

1. Get the value of the input field using :

String str = wdContext.currentContextElement().get<attribute name>();

Here <attribute name> is the value attribute binded to your input field.

2. Pass this value to your BAPI's input parameter

<input model node> input = new <input model node>();

wdContext.node<input model node>().bind(input);

input.set<input parameter>(str);

wdContext.node<input model node>().current<input model node>Element().modelObject().execute();

This will return you the output in the output node.

Invalidate the output node to get the updated value and then read its value

wdContext.node<output node>().invalidate();

wdContext.current<output node>Element().get<attribute name>();

If there are multiple values returned by output node you can bind your output node to table to display them all.

Warm Regards,

Murtuza

Former Member
0 Kudos

Hi Murtuza,

This is perfectly fine but what i require is that as soon as the user enters the input field value ,value should goto backend and the drop down should fill in....

The problem is that after entering the value in input field if the user clicks on drop down values accordingly should be present in drop down fetched from backend......So as such no event is being fired.where do mention the coding as in which hook method...??

Regards

Radhika

Message was edited by:

Radhika Kuthiala

Former Member
0 Kudos

Hi Radhika,

You can't handle the OnEnter kind of event over here. The only event that you have on input field is OnEnter. You can define an action and bind it to the OnEnter event of the input field. The user needs to press ENTER after entering some value in the input field.

Regards,

Murtuza

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Write the coding inthe event 'onSelect' of the dropdownbykey.

Regards

Smitha

Former Member
0 Kudos

Hi ,

Ya you are right but what if the user does not hit enter...There is a new API added in NETweaver 7.1 release WDDoBefore Action...Any pointes regarding the action associated with it....

Regards

Radhika Kuthiala

Former Member
0 Kudos

Hi

wdDoBeforeAction is a Hook method called for additional validation of user input.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

So is it possible that i get the value of input field in this method and pass it to backend so that without performing any event the drop down gets filled...

Regards

Radhika

Former Member
0 Kudos

Hi,

<b>WDDoBeforeAction</b>

Before an action is triggered, you can perform your own validations using this method. The method can only be used for view controllers. It is used for all visible views of the component assigned to the current phase model instance. These include all embedded components.

But, will this make sense for you because you need the action to be fired while you move to dropdown from your input and I think there is no event fired while doing so.

Regards,

Murtuza

Former Member
0 Kudos

Hi Murtuza,

Thsi is what iam thinking that i can get the value of input field attribute and send it to backend ,and fill the drop down accordingly in this action.So that before any action takes place the input field value is checked and drop down filled...

It should work ??

Regards

Radhika Kuthiala

Former Member
0 Kudos

Ya,

If any action is fired then its fine but if user after entering any value in the input field directly jumps to the dropdown field then you might not have the updated data in your dropdown.

You can give it a try if you want.

Regards,

Murtuza

Former Member
0 Kudos

Hi Radhika,

make ur context attribute calculated which is binded to ur drop down. it will generate getter & setter methods. In setter method u can access the value from ur input field & make the call to r/3 system, get the values frm r/3 & put them in ur drop down.

regards

Sumit

Former Member
0 Kudos

Hi Sumit,

I figured out how you make it calculated.......

Thanks and Regards

Radhika Kuthiala

Message was edited by:

Radhika Kuthiala

Former Member
0 Kudos

Hi Radhika,

If it solved ur problem,close the thread.

regards

Sumit