on 02-05-2009 6:10 AM
Hi ,every one,
I am a new to web dynpro for abap.
and I have one question need your help.
I have one inputfield , and I bind it to a Dictionary value ,such as "showView.InfoFrom.Get",This bind is important to me.
but I want to set initialization value of this inputfield.
such as : "please select value"
where Can I do this , can you tell me the code or the step?
thanks very much.
Hi Elisa,
You can do it as follows if your input field accepts character/string input.
1) Go to the context node definition of your component. Then go to the attribute which you are using for binding to your input field. You can there maintain the "default value" property with the text you want to be displayed like, "please select value".
2) Or else you can go to the WDDOINIT method of your view and within this method use the SET_ATTRIBUTE method of IF_WD_CONTEXT_NODE to maintain the default text that you want to be displayed in the input field. Get the reference of your context node and then set the desired value for the attribute.
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi you can generate this code for your variable.
DATA lo_nd_flighttab TYPE REF TO if_wd_context_node.
DATA lo_el_flighttab TYPE REF TO if_wd_context_element.
DATA ls_flighttab TYPE wd_this->Element_flighttab.
DATA lv_seatsmax TYPE wd_this->Element_flighttab-seatsmax.
navigate from <CONTEXT> to <FLIGHTTAB> via lead selection
lo_nd_flighttab = wd_context->get_child_node( name = wd_this->wdctx_flighttab ).
@TODO handle non existant child
IF lo_nd_flighttab IS INITIAL.
ENDIF.
get element via lead selection
lo_el_flighttab = lo_nd_flighttab->get_element( ).
@TODO handle not set lead selection
IF lo_el_flighttab IS INITIAL.
ENDIF.
@TODO fill attribute
lv_seatsmax = 1.
set single attribute
lo_el_flighttab->set_attribute(
name = `SEATSMAX`
value = lv_seatsmax ).
in the value give the default value which ever you want.
Best regards,
Rohit
Hi Elisa,
Welcome to WDA! You said that your input field has the binding as:
showView.InfoFrom.Get
This means that you have a view by name SHOWVIEW & within this view you have a context node by name INFOFROM & under this node you have an attribute GET.
The value of the input field depends on this attribute GET. Go to the CONTEXT tab of your component and navigate to the node INFOFROM. Expand the node & double click on the attribute GET.
Now here you can see the corresponding properties of this particular attribute. You would have 1 property "Default Value" where you can specify the default value for this attribute (input field). Hope this helps.
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
u hve binded the inputbox to one of the attributes..right..if u go to the context tab and click on the node and then click on the attribute(the attribute that u hve binded the input box and this is the one for which u need to set the message).. u will see the properties of the attributes. under these properties u will have an option of DEFAULT VALUE.
u need to enter ur text here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
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.