on 02-23-2010 7:46 AM
Hi,
I am calling on_toggle action on dynamicallly created checkboxes . It is giving me error : " Access Via Null Object Not Possible "
please help.
Thanks,
Pratibha
answered
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pratibha,
I am using the following code in one of my component and it is working fine for me.
DATA: LR_CONTAINER TYPE REF TO CL_WD_UIELEMENT_CONTAINER,
LR_CHECKBOX TYPE REF TO CL_WD_CHECKBOX,
LR_NODE TYPE REF TO IF_WD_CONTEXT_NODE.
CHECK FIRST_TIME = ABAP_TRUE.
LR_CONTAINER ?= VIEW->GET_ROOT_ELEMENT( ).
CL_WD_MATRIX_LAYOUT=>NEW_MATRIX_LAYOUT( CONTAINER = LR_CONTAINER ).
LR_CHECKBOX = CL_WD_CHECKBOX=>NEW_CHECKBOX( BIND_CHECKED = 'NODE2.ATTR1'
BIND_TEXT = 'NODE2.ATTR2'
ON_TOGGLE = 'TOGGLE'
).
CL_WD_MATRIX_HEAD_DATA=>NEW_MATRIX_HEAD_DATA( ELEMENT = LR_CHECKBOX ).
LR_CONTAINER->ADD_CHILD( THE_CHILD = LR_CHECKBOX ).
I have create an action named "TOGGLE" under the actions tab. and did the coding in the ONACTIONTOGGLE method.
For more clarity about dynamic programming, use this blog [Dynamic Programming in Web Dynpro ABAP |http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2915] [original link is broken] [original link is broken] [original link is broken];.
I hope it helps.
Regards
Arjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check ur application in debuggermode or go to the transaction ST22 and check the error analysis.
The error may be because u have not assign any action for on toggle. It may be because of any node is initialized and using it....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.