cancel
Showing results for 
Search instead for 
Did you mean: 

How to control when to activate the OnDaySelect action of a DateNavigator

Former Member
0 Kudos

Hi expert !

I have managed to create a DateNavigator, and to highlight some days in it (thanks to the helpful guys that [helped me there|;), and in an other way I've managed to [create some Popup windows|;.

Now I'd like to manage to show the popups when you click on a highlighted day, but just on it.

But, the onDaySelect action show the popup every time !

So do you have a trick to show the popup only when a day is highlighted ?

Thank you for advance,

Louis

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member201361
Active Contributor
0 Kudos

Hi Louis,

seriously speaking it is very difficult to find whether the selected date is Marked or not to display the pop up window but there is a work around which u can try it out.

1. For the action which u have created and bound to OnDaySelect, create a action parameter say "Day" of type Java.sql.Date.

(in the View Editor--> select Actions Tab --> select ur Action --> in the Below Parametr Table --> create the parameter for ur action)

2. u need to do parameter mapping:

in the outline View --> select the dateNavigator --> right click on it --> Parametr Mapping.

in the pop up window, u will find the Actions for the Date Navigator and in the right hand side u will find the created actions.

if u have bind the action to day select , then mapping will be done between DaySelect to ur Action.

Note : u should have bound the Created Action to the Day Select property of Date Navigator.

in the pop up, drag the created parametr and drop it to the DaySelect parametr day. (Mapping should be done just like context mapping).

Now, u may a have a node for creating marking elements which store the date value, to check whether the selected date in date navigator is highlighted or not , u need to iterate the marker node and check whether the selected date is present in the marker node.

let say ur node is Test and attribute is Date.

for (int i=0;i<wdContext.nodeTest();i++){

ItestElement element = wdContext.nodeTest().getTestElement(i);

Date temp = element.getDate();

if(temp.compareTo(day)==0){

/// then the date is hight lighted , show thw confirmation pop up

}else {

/// dont display the pop up..... ur logic ......

}

}

Here day is the Action parameter.

Hope it helps,

Thanks and Regards