on 04-16-2009 7:15 PM
I created a dropdownbykey using dynamic way like below.
IWDDropDownByKey myDropDown = (IWDDropDownByKey) view.createElement(IWDDropDownByKey.class, "myDropDown ");
myContainer.addChild(myDropDown);
Now I want to add the code to set the onSelect action event for this drop down.
Does anyone knows and can give me this line of code?
Thanks!
Hi Expert,
firstly you have to write code in WddoModify() method .
public void wdDoModify(IWDView view .................,boolean firstTime){
if(firstTime){
IWDDropDownByKey myDropDown = (IWDDropDownByKey) view.createElementIWDDropDownByKey.class, "myDropDown ");
//if attribute created to view context.
IWDAttributeinfo info=(IWDAttributeinfo)wdContext.getNodeInfo().getAttribute("attName");
myDropDown .bindAttribute(info);
ISimpleTypeModifiable ms=info.getModifiableSimpleType();
IModifiableSimpleValueset value=ms.getSVService().getModifiableSimpleValueSet();
value.put("1","sudhira");
value.put('2',"jati');
myDropDown .setOnSelect(wdThis.wdGetClickAction());
then...
you will cretae one action in view controler as Click.
open view--choose action tab in below-click on it--select on NeW button and create action name as Click
hope this will work
thanks
jati
myContainer.addChild(myDropDown);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sherya
Chek this link
Regards
Ruturaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
do the following to create a dropdown by key in the view.
first write the following code in the wddomodifyview()
this will create a new dropdown ui element in the tray havin id "tray".
ddk_id is the id of the dropdown created
now bind its selected key property to the desired attribute
then you can set the onselect property to one of the actions created already in the view.
then write the code for what you want on selecting a particular key in the eventhandler of this action
as showm below:
write this code in wddomodifyview()
if(firstTime)
{
IWDTray mytray = (IWDTray)view.getElement("Tray");
IWDDropDownByKey ddk = (IWDDropDownByKey)view.createElement(IWDDropDownByKey.class,"ddk_id");
IWDAttributeInfo attrinfo = wdContext.getNodeInfo().getAttribute("ddk");
ddk.bindSelectedKey(attrinfo);
*ddk.setOnSelect((IWDAction)view.getAction("SelectAction"));* mytray.addChild(ddk);
}
Write the desired code for the action in the eventhandler as shown below
//@@begin javadoc:onActionSelect(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionSelect(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionSelect(ServerEvent)
//write the code here
//@@end
}
thanks hope it is clear
Sarbjeet Singh Gill
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 new action, say Actn_select
Now write the below code in wdDoModify.
IWDAction act = wdThis.wdGetActn_selectAction();
myDropDown.setOnSelect(act);
Hope this helps..
Jithin
Edited by: jithin james on Apr 17, 2009 6:29 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have created an action "ItemSelected" at design-time, you can assign it using
myDropDown.setOnSelect( wdThis.wdGetItemSelectedAction() );
Armin
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 | |
6 | |
6 | |
6 | |
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.