cancel
Showing results for 
Search instead for 
Did you mean: 

How to work with DateNavigator UI element

Former Member
0 Kudos

Hi All,

I am working with DateNavigator UI element.My requirement is when i am selecting any date on Datenavigator the selected date is to be displayed in the textview.can anybody give me the simple steps of coding for this..........

Thanks in Advance

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Assuming you have selectionMode single set on your Date Navigator, this doesn't sound too difficult. Just data bind the firstSelectedDate property of the dataNavigator to the same context attribute that you bound your TextView to. You can register an event for the action onDaySelect, but you don't have to write any code. Because they have a shared binding, the data will be updated in the textView for you by the framework.

Former Member
0 Kudos

Hi Thomas,

Thanks for your reply.I got the solution depending on your answer.But i dont know how to handle if the selectionmode is range.Can u please help me regarding this...

Edited by: srilalitha yerramsetti on Jan 27, 2009 1:47 PM

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

That is completely different. Now you would need to bind a context attribute to both firstSelectedDate and lastSelectedDate. In the event handler you will have to write code to read the context attributes and concatenate the values together into one string and then update the context attribute that you have bound to the TextEdit with that new value.

Former Member
0 Kudos

I followed ur reply but i am unable to differentiate the output from single to range.what is the difference between single and range modes.what is the use of lastselecteddate in this scenario and can we select multiple dates from datenavigator.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

If you set the DateNavigator to support a range, then the begining date of this range will be placed into the attribute bound to firstSelectedDate and the date for the end of the range will be placed into the attribute bound to lastSelectedDate. Here is also a link to the online help:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/d5/9bac41993ac646e10000000a155106/frameset.htm

Former Member
0 Kudos

Hi,

Check out the examples

WDR_TEST_UI_ELEMENTS,

WDR_TEST_EVENTS.

Create a context attribute for the date to be displayed in textview.

Use the methods of the CL_WD_DATE_NAVIGATOR by getting the reference of this UI in the WDODOMODIFYVIEW then use the methods to get the value in the selected in the Datenavgitor

and store this value in the variable(lv-date).

Bind the context attribute to the text property of the TEXTVIEW .

Using the SET_ATTRIBUTE method of the IF_WD_CONTEXT_NODE try to set the value of context attribute by passing the variable(lv_date).

Regards,

Lekha