on 09-05-2014 1:32 PM
Hello All,
I have a requirement wherein the user wants to add the textbox dynamically at runtime on button click action. My questions is, Is it feasible to dynamically add screen elements at runtime? If yes, how?
Please help.
Thanks
Hi,
Don't go for Dynamic programming if possible.
As Amy told, its better create separate attributes of type WDUI_VISIBILITY with initial values as NONE and bind it to your ui elements at design time.
Based on your requirement/condition you can change the visibility options.
Regards,
Paul Sudhakar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ajinkya,
This is absolutely possible! Adding view elements at runtime is called "dynamic programming". There are a lot of good resources and tutorials on SCN if you do a search. To start you off, here is an excellent series by :
Another option that avoids dynamic programming is to create the view element at design time but bind its visible property to a context attribute of type WDUI_VISIBILITY. You could initially set its visibility to "none" until the user clicks the button, then you could change its visibility to "visible".
Cheers,
Amy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
For this you have to do coding in MODIFY VIEW method of your view.
for Each elements SAP has provided one dynamic class.
For text view you can use this class CL_WD_TEXT_VIEW.
First create the Text view by using static method of class NEW_TEXT_VIEW and give the ID and bind the context attribute to by using this method after creating instance BIND_TEXT.
and add the view element to your layout type and set the position.
Regards,
Nishant
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
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.