on 01-05-2012 5:06 AM
In my screen we have to enter the material no in I/O Box and click on Create radio button and press ok button means. It should go to Create View..
How to give action code for create radiobutton and where we have to enter the code..
Please post the sample code for giving action to radiobutton.... Tell in step by step process
Hi,
create a context attribute for Material number like MATNR type MATNR.
go to the layout, craeate the input field input field UIelement and bind the VALUE property to the MATNR attribute.
Create the button in layout and give the name as submit and create the actionto it as SUBMIT.
There are different types in radio button-> by key and by index..
create 2 views one for selection screen and other for matieral creation.
Define the plugs and link them using navigation plugs.
How many radio buttons are there..in your requirement...what each one does...
Create a attribute of type CHAR1 ..or any of your defined type
Create a radiobutton group in the LAyout and add the radibuttons to this group by righ click...and assign that to the attribute.
As you have specified, one is for CREATE-.
on the SUBMIT action handler, read the attrinute for matnr and aslo the radiobutton realted one..now you will get the values
using the code wizard (READ->CONTEXTNODE) you will have the code generated.. and fire the plug..
Examples -> WDR_TEST_UI_ELEMENTS and WDR_TEST_EVENTS.
Please specify the requriement clearly...
Regards,
Lekha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
http://prabhuabap.blogspot.com/2012/01/webdynpro.html
this is my design page..
In the Material Box we have to enter the material no and click on Create radio button and press ok means. It should go to Create View..
How to give action code for create and where we have to enter the code..
Please tell in screen shotu2026u2026
From what you describe I would say put the code in an action handler behind the OK-Button. But what do you mean with "Create View"? Could you technically be more specific what should happen? Are you dynamically creating a new view? Or do you want to navigate? Or is there just some kind of output you want then?
Cheers, Lukas
Hi,
onAction of OK button you need to write code,
First read the radio button value.
if it is create,
wd_this->fire_to_create_plg( ). " to_create is the outbound plug . You need to create out bound plug in your view
hope this helps u.,
revert if you need some more clarification.
Thanks & Regards,
Kiran.
Hi,
When you want to navigate to create view?. when click on Ok button or when selecting radio button..?
If you want to navigate to create view when click on ok button you need to write in OnActionOk. else for radio button also you will have one event called onSelect. You can create an action for that and write your code.
In onActionOk or onActionCreate,
Read the attribute using wizard to which you bind your radio button texts.
Let say you created a node called NODEA with cardinality 0..n and you created attribute TEXT under NODEA and you binded your radiobutton texts to TEXT attribute under node.
Now Read the attribute TEXT under NODEA using wizard.
now it will automatically generate code.
Now lv_text contains the selected radio button text.
if lv_text is create,
Navigate to create view using fire outbound plug.
check this code below,
DATA lo_nd_rdb TYPE REF TO if_wd_context_node. " here rdb is your node name.
DATA lo_el_rdb TYPE REF TO if_wd_context_element.
DATA ls_rdb TYPE wd_this->Element_rdb.
DATA lv_text TYPE wd_this->Element_rdb-text.
* navigate from <CONTEXT> to <RDB> via lead selection
lo_nd_rdb = wd_context->get_child_node( name = wd_this->wdctx_rdb ).
* @TODO handle non existant child
* IF lo_nd_rdb IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_rdb = lo_nd_rdb->get_element( ).
* alternative access via index
* lo_el_rdb = lo_nd_rdb->get_element( index = 1 ).
* @TODO handle not set lead selection
IF lo_el_rdb IS INITIAL.
ENDIF.
* get single attribute
lo_el_rdb->get_attribute(
EXPORTING
name = `TEXT`
IMPORTING
value = lv_text ). " this lv_text contains your selected radio button value
if lv_text = 'Create'.
wd_this->fire_to_create_plg( " here to_create is the outbound plug name.
).
elseif ....
endif.
check this article for navigation demo: [Navigation in WDA|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/308ebfe9-a07a-2c10-e494-9849d50efc88?QuickLink=index&overridelayout=true]
Hope this helps u,
Thanks & Regards,
Kiran.
User | Count |
---|---|
86 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.