on 06-24-2015 8:15 AM
Hi,
I have a WebDynpro ABAP View where I added a container and an input field during runtime. I added the onEnter event to the input field.
On enter the corresponding action method is called, but if I try to get the data entered by the user that fails.
If call
lo_context_element = wdevent->get_context_element('CONTEXT_ELEMENT').
this fails because context elements are initial:
Debugger view on lo_context_element: CONTEXT_ELEMENT ->->{O:initial}
Do you have any ideas what I missed?
Thanks for any hints!
Cheers
Martin
I analysed the issue deeper now. The context element is still initial when the on_enter action method is called.
As I already said, I added the input fields dynamically at runtime. I tried to add this input fields to a static defined context with cardinality 0:1.
At runtime there are three instances of the context node. How do I have to reference the <fieldA> of third instance of my context node?
lo_input = cl_wd_input_field=>new_input_field( | |
id = 'Inputfield1' | |
read_only = abap_true | |
bind_value = NODE3.ATTRIBUTE1 | |
length = 10 | |
). |
This seems to be wrong. Do you have any idea what? Is the "3" after "NODE" wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Martin,
hope that I get you right: You have a context node (called NODE) with at least 3 elements. One attribute of this element is called ATTRIBUTE1.
If you like to bind the field to element 3 of the node, you need to set the lead selection to this element.
Method NEW_INPUT_FIELD() requires for parameter VALUE the absolute path of the context attribute as string. You cannot reference a special element of the context node within this string. It is using the lead selection.
Kind regards, Anja
Hi Anja,
Thank you very much for your answer! That was the right solution. I set the lead selection and got the path of that element for the binding. It's cool to get advise from old team mates 🙂 good old times!
I also found the reason why the context element is initial in the event context.
coding for a workaround.
It would be cool, if that could be added to the SAP documentation of the on_enter event.
Cheers,
Martin
Some times writing about an issue helps. As I realized that the ID of wdevent is filled with the UI element name , the reason might be that the context binding is missing. Or do you see any other reasons for that behaviour?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.