Skip to Content
avatar image
Former Member

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

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|Using a DateNavigator as a CalendarYearView;), and in an other way I've managed to [create some Popup windows|Problem with confirmation popup window;.

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 11, 2009 at 02:13 PM

    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

    Add comment
    10|10000 characters needed characters exceeded