cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the selected Calender Date

Former Member
0 Kudos

Hello experts,

could anyone please let me know how I can write the selected Day(Calendar) in a Attribute?

Thanks

Regards

Marco

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Please go through this link

Hope you will find your answer

Regards

Ruturaj

Former Member
0 Kudos

Hi experts,

sorry but I am not able do read the selected date.

I' ve done following:

IActualDateNode actualDate = wdContext.nodeActualDate();

IActualDateElement actualDateElement = wdContext.createActualDateElement();

actualDateElement.setSelectedDate(Calendar.DAY_OF_MONTH);

actualDate.addElement(actualDateElement);

But if I click on the calendar I get always a "5" as Value.

What did I wrong??

Thanks a lot!

Former Member
0 Kudos

Hi,

What is the data type of SelectedDate attribute?

If this is date do as follows

IActualDateNode actualDate = wdContext.nodeActualDate();

IActualDateElement actualDateElement = wdContext.createActualDateElement();

actualDateElement.setSelectedDate(new Date(Calendar.getInstance().getTimeInMillis()));

actualDate.addElement(actualDateElement);

Regards

Ayyapparaj

Former Member
0 Kudos

Thanks a lot. But now if i click on the calendar the Value is alwasy"13.10.2008". So it`s the actual Date and not the Date I clicked on.

Any ideas why it is alwas the 13.10.2008??

Many thanks

Former Member
0 Kudos

Hi,

Any ideas why it is alwas the 13.10.2008??

Following line sets the date to current date.

actualDateElement.setSelectedDate(new Date(Calendar.getInstance().getTimeInMillis()));

I would like to know where you have placed this code? If its in wdDdomodify move this to wdDoinit.

Regards

Ayyapparaj

Former Member
0 Kudos

I should explain my problem again. Sorry missunderstanding from my side.

I have a DateNavigator implemented.

Now I want to set up a method which gives me the date where I clicked on the calender.

So if I cklick on 24.12.2008 the Value "24.12.2008" should be written in actualDateElement.

Former Member
0 Kudos

Hi,

Do you really need a date navigatror UI component ?

Why not use a context attribute of type and bound this to a InputField, Here too you will get a date selector.

You can still use the same code to set the default date to current date and on change you will be able to see the selected one.

Regards

Ayyapparaj

Former Member
0 Kudos

Yes I really need the DateNavigator.

Unfortunately there is no other possibility to implement the calender.

My Goal is that if a User click on a calender date a PopUp Window open all tasks in conclusion to the selected date.

Hope this is possible.

Thanks"

Former Member
0 Kudos

Hi,

To Create a calendar

Create a attribute of type Date

Bind this to the input field.

Regards

Ayyapparaj

Former Member
0 Kudos

I have created a CalenderNavigater as UI-Element. There is no Input Field.

The Properties of the UI - Element does not give the oppurtunity to mapp a type.

But I can define a Event called "onSelect".

This means if I select a Entry in my Calendar this Event will run. And there in it I will read the selected Date and write it in a Contexttype.

Thanks!

Former Member
0 Kudos

Hi,

In the tool bar you will be able to find Input Field.

Create a context attribute of type Date

bind this to the value property of the input field.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

ok i have now created a InputField. But now if I click on a day i have always this date in my context :01.01.1970.

Oh jesus that is really hard. I just want the date which i select in my calender.

Shouldn' t I implement somethin on the even onActionSelect????

Regards and many thanks

Marco

Former Member
0 Kudos

Hi,

IActualDateNode actualDate = wdContext.nodeActualDate();

IActualDateElement actualDateElement = wdContext.createActualDateElement();

actualDateElement.setSelectedDate(new Date(Calendar.getInstance().getTimeInMillis()));

actualDate.addElement(actualDateElement);

If you are still using the above code you will be able to see the current date by default.

Once you change the date print it from the same context using

dComponentAPI.getMessageManager().reportSuccess(

wdContext.currentActualDateElement().getSelectedDate().toString());

Regards

Ayyapparaj

Former Member
0 Kudos

You just have to bind the property "firstSelectedDate" of the DateNavigator to some context attribute "selectedDate" of DDIC type "date". Then you can access the selected data with


java.sql.Date selectedDate = wdContext.currentContextElement.getSelectedDate();

Armin

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi

please go through this link Hope u will find ur answer

https://www.sdn.sap.com/irj/sdn/advancedsearch?query=gettingtheselectedCalenderDate+&cat=sdn_all&start=1

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e012e6a2-8d21-2a10-1bb8-d9b606f3...

Regards

Ruturaj

Former Member
0 Kudos

Hi

please go through this link Hope u will find ur answer

https://www.sdn.sap.com/irj/sdn/advancedsearch?query=gettingtheselectedCalenderDate+&cat=sdn_all&start=1

Regards

Ruturaj

DeeptiChavare
Active Participant
0 Kudos

Hi Marco,

DAY_OF_MONTH is a constant in Calendar class.

use Calendar.DAY_OF_MONTH as I have showed in the previous reply.

Regards,

Deepti

Former Member
0 Kudos

Hi Marco,

"DAY_OF_MONTH" is a constant which can accessed only using Calender instance and not directly.

If you can see the error "Day_OF_MONTH cannot be resolved" then u need to access it with a calender instance.

DeeptiChavare
Active Participant
0 Kudos

Hi,

class Calender has method get() which accepts an integer parameter. You can get selected day using this method.

Try

get(Calendar.DAY_OF_MONTH)

Regards,

Deepti

Former Member
0 Kudos

Hi,

thank you for your quick answer.

I tried following:

Date date = Calendar.get(DAY_OF_MONTH);

But "Day_OF_MONTH"cannot be resolved.

Can you see the Error?

Thanks