on 01-08-2009 3:45 PM
Hi experts,
I am trying to use date navigator UI. I want to capture current selected month in the date
navigator UI. I tried doing it through parameter mapping with no success. Can anybody tell me an easy way to get current selected month in the date navigator UI .
Thanks in advance
Abhay
What exactly did you try and what does not work?
You can get the selected month either from the selected date (firstSelectedDate property) or by mapping event parameter IWDOnMonthSelect.MONTH to an integer attribute.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi armin
Thanks a lot for reply . I have craeted navigator UI . then I created an action and attached it
to action MonthSelect. But I am not sure how to add event parameter in the WDdo modify view.
I have put like this in wddomodify()
IWDDateNavigator DATE = (IWDDateNavigator) view.getElement("DateNavigator");
DATE.mappingOfOnMonthSelect().addSourceMapping("IWDOnMonthSelect.MONTH","month");
Kindly let me know the correct way .
Abhay
Hi Kishan
I did not paste code here. I typed it here, hence i missed one ",". But problem wasn't this otherwise it would have given me an exception. I messed up with action type of date navigator , now I fixed it.
Thanks for reply .
Abhay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi armin ,
I have paste same code in wddomodify view, and at design time I created an action onMonth select with parameter "month". then after I tried to print this parameter in the action's event handler , but its blank .
Do modify view()
{
IWDDateNavigator dn = (IWDDateNavigator) view.getElement("DateNavigator");
dn.mappingOfOnMonthSelect().addSourceMapping
(IWDDateNavigator.IWDOnMonthSelect.MONTH,"month")
}
public void onActionMonthSelect(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String month )
{
//@@begin onActionMonthSelect(ServerEvent)
wdContext.currentContextElement().setDe("Selected parameter : "+month);
//@@end
}
Please let know where I am doing sily mistake.
Thanks
Abhay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhay,
public void onActionMonthSelect(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String month )
{
//@@begin onActionMonthSelect(ServerEvent)
wdContext.currentContextElement().setDe("Selected parameter : "+month);
//@@end
}
What's this??? You can't use System.out.println() logic here. Use this code to set your context attribute,
wdContext.currentContextElement().setDe(month);
You can use this code to print what to need to,
wdComponentAPI.getMessageManager().reportSuccess("Selected parameter : ", +month);
Regards
Kishan
User | Count |
---|---|
85 | |
10 | |
9 | |
8 | |
6 | |
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.