on 04-27-2007 12:55 PM
Hi,
I want to assign values to TextView user interface element at run time in ABAP webdynpro? how? plz give the syntax.
hi Mog ,
What do you exactly mean by "assign values to TextView user interface element at run time " .
After my Understanding you can do
Sol. 1 ) You said you want assingn value to Textview at runtime .
Do one thing .Make Node with element .Now Bind your property of textview (Which you want to have at runtime ) to element in Context . Now Based on Value itgets it shows you Textview in that way .
Solution 2) If you want creat UI element at run time and set its properties , you can do one thing go for Dynamic Programming .
<a href="/people/thomas.szcs/blog/2005/12/28/dynamic-programming-in-web-dynpro-abap--introduction-and-part-i-understanding-ui-elements Programming Web blog</a>
<a href="/people/thomas.szcs/blog/2006/01/03/dynamic-programming-in-web-dynpro-abap--part-ii-handling-viewelements Programming Web blog 2</a>
Sample code for Dynamic Programming .
**********************************************************************************************
METHOD wddomodifyview .
DATA:
lr_container TYPE REF TO cl_wd_uielement_container,
lr_button TYPE REF TO cl_wd_button,
text TYPE string.
CONSTANTS:
lc_description TYPE string VALUE 'DESCRIPTION'.
let's do it only once
CHECK first_time = abap_true.
get a pointer to the RootUIElementContainer
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
create the button and add it to the container
lr_button = cl_wd_button=>new_button( bind_text = lc_description on_action = 'ON_ACTION' ).
cl_wd_flow_data=>new_flow_data( element = lr_button ).
lr_container->add_child( lr_button ).
fill the context attribute with the OTR text
text = cl_wd_utilities=>get_otr_text_by_alias( 'SOTR_VOCABULARY_BASIC/CONFIRM' ).
set the value of the text in the context attribute
wd_context->set_attribute( name = lc_description value = text ).
ENDMETHOD.
**********************************************************************************************
Hope I have given some Direction to you.
Cheers
Parry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mog, what do you mean "assign values to TextView user interface element at run time"? You wanna change binding of UI element properties? Or you wanna just change value of context attribute bound to UI element properties?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mog,
Check out the standard WD ABAP examples,
WDR_TEST_UI_ELEMENTS
WDR_TEST_EVENTS
In this they have mentioned all the reaquired UI elements and their different
properties. You can fill the context node at runtime.
Hope this will help you.
Cheers,
Darshna.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
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.