on 07-24-2012 3:19 AM
Hello
I have a view say, my_view, it has a node say, my_node, it has 2 attributed, say, attr_1 and attr_2
I have put the TimedTrigger UI elements on my_view, but every time for this triggering of TimedTrigger my data is loosing/refreshing, hence by SDN experts suggestion, i am trying to change the cursor FOCUS onto a dummy filed, so, i wrote the below code
Tree str. of context is as below
MY_NODE
| --- ATTR_1
|
| --- ATTR_1
* Set focus on dummy fld
DATA: lr_if_wd_view TYPE REF TO if_wd_view.
DATA: lr_elem TYPE REF TO if_wd_view_element.
lr_elem = lr_if_wd_view->get_element( 'ATTR_2' ). " its a Dummy fld meant for just set the focus so that i will retain my user entered data on the "screen
IF lr_elem IS BOUND.
lr_if_wd_view->request_focus_on_view_elem( lr_elem ).
ENDIF.
But, am getting NULL reference short dump, pls. correct the code pls?
Hi,
The dump may be coming because You have not initialized LR_IF_WD_VIEW anywhere.
If the code is in WDDOMODIFYVIEW method, add one statement.
LR_IF_WD_VIEW = VIEW.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To write this statement you first need the reference of the view you are currently on i.e. VIEW which is only available in WDDOMODIFYVIEW Method.
Since you need to write the code in your action handler follow the steps.
1. Go to 'Attributes' tab of Component Controller.
2. Declare a variable LO_VIEW of type Ref to IF_WD_VIEW ( Check both the checkboxes there )
3. Go to your view VIEW1
4. Go to WDDOMODIFYVIEW method of VIEW1
5. Write the code: WD_COMP_CONTROLLER->LO_VIEW = VIEW
6. Go to your action handler method DO_POPUP_MESSGAE_ON_TIMED_TRIGGER in VIEW1.
7. Write code:
LR_IF_WD_VIEW = WD_COMP_CONTROLLER->LO_VIEW.
lr_elem = lr_if_wd_view->get_element( 'ATTR_2' ).
.... and your entire code
If you are unclear on what you are doing or why you are doing this, post back.
Hope this helps.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.