on 07-29-2010 7:42 PM
Hi All,
I am working on webdynpro application.I have 3 fields and two buttons called 'create' and 'display'.
Intially my fields are in editable mode
1) .If i click on 'Display' on all fields should come to 'No-Editable' Mode.Please let me know how cani do this.
When i am clicking on 'display' my data is poulated perfectly.
2) When i click on 'create' all the data should be cleared or refreshed.
Can you please let me know how can i achieve this.
Thanks,
Taragini
Hi,
1)Bind ur fields with the context attribute of type WDY_BOOLEAN. There is a value propery of ur field. Bind that property.
2) Now create a action for ur button . In the method OnAction of the button , u need to set the attribute , to '01' or ABAP_FALSE to make the field non editable
3) for this, u can go to code wizard. press control+f7. choose the radio button to read/set the attribute
DATA lo_nd_cn_editable TYPE REF TO if_wd_context_node.
DATA lo_el_cn_editable TYPE REF TO if_wd_context_element.
* navigate from <CONTEXT> to <CN_EDITABLE> via lead selection
lo_nd_cn_editable = wd_context->get_child_node(
name = wd_this->wdctx_cn_editable ).
* get element via lead selection
lo_el_cn_editable = lo_nd_cn_visiblesuper->get_element( ).
* set single attribute
lo_el_cn_editable->set_attribute(
EXPORTING
name = `CA_EDITABLE`
* IMPORTING
value = '01' ).
// context attribute ca_editable under the context node cn_editable
// set the attribute to '01' for dispaly mode
Similarly in the OnAction method of ur Create button , u can go to the code wizard and choose to read the context node , which is having all the attributes . there u can choose the method invalidate()
lr_node = wd_context->get_child_node( name = lv_node ).
lr_node->invalidate( ).
regards,
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
First declare an attribute of type char1 with a default value as X.
Go to the input field. In the properties tab you can set the visibility of the field. Bind that field with the created attribute.
As the default value is X, initially all the fields will be editable.
When you click on display button, write the below code.
DATA lo_nd_nd_vis1 TYPE REF TO if_wd_context_node.
DATA lo_el_nd_vis1 TYPE REF TO if_wd_context_element.
DATA ls_nd_vis1 TYPE wd_this->element_nd_vis1.
DATA lv_vis LIKE ls_nd_vis1-vis.
lo_nd_nd_vis1 = wd_context->get_child_node( name =
wd_this->wdctx_nd_vis1 ).
lo_el_nd_vis1 = lo_nd_nd_vis1->get_element( ).
lo_el_nd_vis1->set_attribute(
name = `VIS`
value = ' ' ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ya sorry. Just misunderstood with the requirement.
@Tarangini
Please check the below link.
[Webdynpro ABAP - Sample Code|http://wiki.sdn.sap.com/wiki/display/WDABAP/SimpleapplicationtochangepropertiesofUIElementsduringruntimeinWebDynpro+ABAP]
It will give you the step by step procedure in using the visibility and enable property.
Hi Taragini,
This can be done easily with the following steps:
1. Create a view context attribute READ_ONLY_FLAG with type boolean.
2. For the input fields of your interests, associate the context attribute with the "readOnly" property.
3. In the action for Display button, set the value of READ_ONLY_FLAG contribute to 1. Vice versa, set READ_ONLY_FLAG to 0 in onActionCreate. Also clear the data in the same action.
Regards,
Min
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 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.