on 04-11-2007 3:47 PM
Hi all,
Can we add checkboxes to the screen at the runtime?
Thanks & Regards
Santhosh
Hi Santosh.
Yes you can add checkboxes at runtime. This can be done in the method
wddomodifyview:
method WDDOMODIFYVIEW .
data: LR_CONTAINER type ref to CL_WD_UIELEMENT_CONTAINER,
LR_CHECKBOX type ref to CL_WD_CHECKBOX,
LR_FLOW_DATA type ref to CL_WD_FLOW_DATA.
LR_CHECKBOX = CL_WD_CHECKBOX=>NEW_CHECKBOX( ).
LR_FLOW_DATA = CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = LR_CHECKBOX ).
LR_CONTAINER ?= view->GET_ELEMENT( 'ROOTUIELEMENTCONTAINER' ).
LR_CONTAINER->ADD_CHILD( LR_BUTTON ).
endmethod.
For mor info check out the <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/11/ba74412cba127de10000000a155106/content.htm">help site</a>.
Generally you should consider that dynamically adding UI elements lower the
maintainability of the application.
Hope this helps,
Cheers
P.S: WDDOMODIFYVIEW has the parameter first_time which
indicates whether the method is called the first time.
Keep in mind that the method is called each roundtrip.
Message was edited by:
Sascha Dingeldey
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi santhosh ,
Yes Of course you can add Checkboxes dynamically .
Basically It is not just about checkbox , one can add any UI element dynamically .May you can add button or change the layout with Dynamic programming .
another thing you need to write code on OnWDModifyView Because you are adding something dynamically on change of same view .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check out the following helps sites:
Phase Model
Dynamic Layout manipulation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I want to know that more detailed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Santosh.
Go to the view and click the methods tab. Then you see the standard methods like
wddoinit and wddomodifyview.
Check out the following helps sites:
<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/d2/8acd409cc4dd50e10000000a1550b0/content.htm">Phase Model</a>
<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/11/ba74412cba127de10000000a155106/content.htm">Dynamic Layout manipulation</a>
Cheers,
Sascha
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.