cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically get id of input field using search help

Former Member
0 Kudos

Hi All,

I have a scenario like this:

In a view I have five input fields.User names needs to be given in all of them and data comes from the same value table.So I have created a custom search help and attached it for all the input fields.But how can it

be known which input field has called the search help?

I have created a separate component for the freely programmed search help.And in the component containing the input fields there is a method for populating the UI context.Here I need to know the id of the calling input field.

Thanks in advance.

Arpan

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

In your freely programmed value help, you had to add component interface IWD_VALUE_HELP. This automatically adds the component controller method SET_VALUE_HELP_LISTENER. This method will be called by the value help framework. This method has an importing parameter called LISTENER of type ref to IF_WD_VALUE_HELP_LISTENER. It is this LISTENER object that you can use to query information about the source of the value help trigger. You can't directly read the UI element input field ID - but yo ucan get direct access to the bound context element and attribute of the field that triggered your input help. This should actually tell you much more than the id of the input field.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Thomas,

Thanks for you answer, my problem is resolved.Only another question when I am accessing the calling attribute I am getting a NULL reference error.Why is that?In the F4 component do I have to create a node which is identical to the node in the calling component.Right now I just created a node called Internal_node and created an attribute which has the type of calling attribute.

Cheers,

Arpan

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Hi Thomas,

> Thanks for you answer, my problem is resolved.Only another question when I am accessing the calling attribute I am getting a NULL reference error.Why is that?In the F4 component do I have to create a node which is identical to the node in the calling component.Right now I just created a node called Internal_node and created an attribute which has the type of calling attribute.

>

> Cheers,

> Arpan

Can't say. The attribute via the callback interface shouldn't be null. You don't need to create any local nodes if you don't want to. I would need to know more about the dump to comment further.