on 05-30-2008 8:28 AM
HI All,
I am having EDIT/Display text.
When the page is initial the text of the button should be EDIT.
After entering the fields and update the records into the table which is inthe same page,the button should change to Display
Cheers,
Mahalakshmi.K
Hi,
Please follow the steps below (I'm assuming that the button's name is BTN1 and it is bound to a context attribute with the name BTNLABEL of type String)
1.) Create an action for the button using the Properties section of the view.(Lets say you created the action called "SELECT")
2.) Double click the action and you will be taken to the Methods section of the View. This is where you will write the code.
3.) Now what you need to do is use the Webdynpro method and read the context of the attribute "BTNLABEL" - do this by clicking the Web Dynpro wizard button and then select "READ CONTEXT" from the options - select the "BTNLABEL" attribute as well.
4.) After the code is inserted in the method - please add the ABAP code for the following pseudocode..
if lv_btnlabel eq 'EDIT.
lv_btnlabel = 'DISPLAY'
else.
lv_btnLABEL = 'EDIT'.
endif.
bind the variable to the control using the wizard after this.
Hope ths helps. Let me know
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
when you click on the wizard icon u get an option to rad the context, there you can see all of ur nodes and attributes.
selct the attribute you want to read and press enter
the code will be generated.
here you will get the code as.
lo_el_element->get_attribute
exporting
name = ' ATT1'.
importing
value = lv_value.
to set the value to the attribut you have to change the code like this:
lo_el_element->set_attribute
exporting
name = ' ATT1'.
value = 'text'. "this sets the text of ur button "
Hi u can create an attribute of type string. and bind it with the text property of the button.
in the init method you can set the value for attribute as "EDIT".
then when you enter some values and update your table. at the end of the code for updation you can set the value for attribute as "DISPLAY".
regards
chythanya.v
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create a context attribute say BUTTON_TEXT. Bind the property 'Text' of the button you created to the context attribute BUTTON_TEXT.
Now, in the code, you can change the text of the button, by changing the value of the attribute 'BUTTON_TEXT'.
Regards
Wenonah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.