on 02-16-2010 8:54 AM
Hi,
I have to create a WD application where I will have an input field, a submitt button and a textview.
The scenario is such that if I put any thing in input field and click submit button, whatever I have written in input field it will be shown in textview.
Please suggest me how to proceed.
Thanking you,
Anindita
hi ,
this is very basic ..
1 In the Layout tab just place these UI elements in ur view from the root element container ..
2 now go to context tab , make a context node say CN_NODE and 2 context attributes of type string under it ..
3 Bind the Value property of ur Input field with one of these context attributes ca_attr1
4 Also bind the Text property of ur Text View to the other attribute ca_attr2
5 now use the OnAction property of ur Button UI .make a action and in the OnAction method , u have to do the following
a) read the value which user enters using get_attribute method
b) set the Text property of ur Text View with this value using the set_attribute method
when in the corresponding method , u wud press Control+F7 and choose read context node/attribute and choose the particular attribute the following code wud be automatically generated:
DATA lo_nd_cn_node TYPE REF TO if_wd_context_node.
DATA lo_el_cn_node TYPE REF TO if_wd_context_element.
DATA ls_cn_node TYPE wd_this->element_cn_node .
DATA lv_attr LIKE ls_city-ca_attr.
* navigate from <CONTEXT> to <CN_NODE>
lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_ca_attr1).
* get element via lead selection
lo_el_cn_node = lo_nd_cn_node->get_element( ).
* get single attribute
lo_el_cn_node->get_attribute(
EXPORTING
name = `CA_ATTR1`
IMPORTING
value = lv_attr ).
now simply set the other attribute with this value
lo_el_cn_node->set_attribute(
EXPORTING
name = `CA_ATTR2`
value = lv_attr ).
rgds,
amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arindam,
Create on context attribute and bind this with both input field and text view elements.
No need to wirte any code for that the data will copied automatically from input field to text view element.
Regards,
Vikrant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check basic WebDynpro Documentation.....
[WebDynpro ABAP|http://aiokeh.wdf.sap.corp:50000/SAPIKS2/contentShow.sap?_SCLASS=IWB_STRUCT&_SLOIO=7C3545415EA6F523E10000000A155106&TMP_IWB_TASK=DISPLAY&RELEASE=690&LANGUAGE=EN&_SEQNUM=0]
one clue - bind both to same context attribute
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
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.